Package org.onosproject.net.statistic
Class DefaultLoad
- java.lang.Object
-
- org.onosproject.net.statistic.DefaultLoad
-
-
Constructor Summary
Constructors Constructor Description DefaultLoad()Creates an invalid load.DefaultLoad(long current, long previous)Creates a load value from the parameters.DefaultLoad(long current, long previous, long interval)Creates a load value from the parameters.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisValid()Indicates whether this load was built on valid values.longlatest()Obtain the latest bytes counter viewed on that link.longrate()Obtain the current observed rate (in bytes/s) on a link.static voidsetPollInterval(long newPollInterval)Sets the poll interval in seconds.longtime()Returns when this value was seen.java.lang.StringtoString()
-
-
-
Constructor Detail
-
DefaultLoad
public DefaultLoad()
Creates an invalid load.
-
DefaultLoad
public DefaultLoad(long current, long previous)Creates a load value from the parameters.- Parameters:
current- the current valueprevious- the previous value
-
DefaultLoad
public DefaultLoad(long current, long previous, long interval)Creates a load value from the parameters.- Parameters:
current- the current valueprevious- the previous valueinterval- poll interval for this load
-
-
Method Detail
-
setPollInterval
public static void setPollInterval(long newPollInterval)
Sets the poll interval in seconds. Used solely for the purpose of computing the load.- Parameters:
newPollInterval- poll interval duration in seconds
-
rate
public long rate()
Description copied from interface:LoadObtain the current observed rate (in bytes/s) on a link.
-
latest
public long latest()
Description copied from interface:LoadObtain the latest bytes counter viewed on that link.
-
isValid
public boolean isValid()
Description copied from interface:LoadIndicates whether this load was built on valid values.
-
time
public long time()
Description copied from interface:LoadReturns when this value was seen.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-