Package org.jumpmind.symmetric.transport
Class BandwidthTestResults
java.lang.Object
org.jumpmind.symmetric.transport.BandwidthTestResults
A very simple bandwidth meter. It calculates the mean of different consecutive bandwidth measurements.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
Returns the number of milliseconds elapsed between start() and stop().double
getKbps()
Returns the bandwidth used in kbits/s beetween start() and stop().long
getTotal()
Returns the number of bytes sent between start() and stop().void
start()
Starts the bandwidth measurement.void
stop()
Ends the bandwidth measurement.void
transmitted
(int n) Called when a bunch of data has been transmitted.
-
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().
-