Class CAOctetsPerSecond

java.lang.Object
com.io7m.cardant.client.basic.internal.CAOctetsPerSecond

public final class CAOctetsPerSecond extends Object
An octets-per-second calculator.
  • Constructor Details

    • CAOctetsPerSecond

      public CAOctetsPerSecond(Clock inClock)
      Create a new octets-per-second service.
      Parameters:
      inClock - The clock
  • Method Details

    • isReadyForMore

      public boolean isReadyForMore()
      Returns:
      true if the service is ready for more samples
    • average

      public double average()
      Returns:
      The current average
    • add

      public void add(long octets)
      Add a new sample
      Parameters:
      octets - The number of octets received
    • toString

      public String toString()
      Overrides:
      toString in class Object