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 boolean
isValid()
Indicates whether this load was built on valid values.long
latest()
Obtain the latest bytes counter viewed on that link.long
rate()
Obtain the current observed rate (in bytes/s) on a link.static void
setPollInterval(long newPollInterval)
Sets the poll interval in seconds.long
time()
Returns when this value was seen.java.lang.String
toString()
-
-
-
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:Load
Obtain the current observed rate (in bytes/s) on a link.
-
latest
public long latest()
Description copied from interface:Load
Obtain the latest bytes counter viewed on that link.
-
isValid
public boolean isValid()
Description copied from interface:Load
Indicates whether this load was built on valid values.
-
time
public long time()
Description copied from interface:Load
Returns when this value was seen.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-