Class BandwidthTestResults

java.lang.Object
org.jumpmind.symmetric.transport.BandwidthTestResults

public class BandwidthTestResults extends Object
A very simple bandwidth meter. It calculates the mean of different consecutive bandwidth measurements.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Returns the number of milliseconds elapsed between start() and stop().
    double
    Returns the bandwidth used in kbits/s beetween start() and stop().
    long
    Returns the number of bytes sent between start() and stop().
    void
    Starts the bandwidth measurement.
    void
    Ends the bandwidth measurement.
    void
    transmitted(int n)
    Called when a bunch of data has been transmitted.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BandwidthTestResults

      public BandwidthTestResults()
  • Method Details

    • start

      public void start()
      Starts the bandwidth measurement.
    • transmitted

      public void transmitted(int n)
      Called when a bunch of data has been transmitted.
      Parameters:
      n - Number of bytes that have been transmitted.
    • stop

      public void stop()
      Ends the bandwidth measurement.
    • getKbps

      public double getKbps()
      Returns the bandwidth used in kbits/s beetween start() and stop().
      Returns:
      Bandwidth in Kbps.
    • getElapsed

      public long getElapsed()
      Returns the number of milliseconds elapsed between start() and stop().
      Returns:
      Number of milliseconds elapsed between start() and stop().
    • getTotal

      public long getTotal()
      Returns the number of bytes sent between start() and stop().
      Returns:
      Number of bytes sent between start() and stop().