|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.floodlightcontroller.counter.SimpleCounter
public class SimpleCounter
This is a simple counter implementation that doesn't support data series. The idea is that floodlight only keeps the realtime value for each counter, statd, a statistics collection daemon, samples counters at a user-defined interval and pushes the values to a database, which keeps time-based data series.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface net.floodlightcontroller.counter.ICounter |
---|
ICounter.DateSpan |
Field Summary | |
---|---|
protected CounterValue |
counter
|
protected java.util.Date |
samplingTime
|
protected java.util.Date |
startDate
|
Constructor Summary | |
---|---|
protected |
SimpleCounter(java.util.Date startDate,
CounterValue.CounterType type)
Protected constructor - use createCounter factory method instead |
Method Summary | |
---|---|
static ICounter |
createCounter(java.util.Date startDate,
CounterValue.CounterType type)
Factory method to create a new counter instance. |
static ICounter |
createCounter(ICounter copy)
Factory method to create a copy of a counter instance. |
java.util.Date |
getCounterDate()
This is the method to retrieve the last sampling time. |
CounterValue |
getCounterValue()
This is the method to retrieve the current value. |
void |
increment()
This is the key method that has to be both fast and very thread-safe. |
void |
increment(java.util.Date d,
long delta)
Used primarily for flushing thread local updates |
protected void |
init(java.util.Date startDate,
CounterValue.CounterType type)
|
void |
reset(java.util.Date startDate)
Reset value. |
void |
setCounter(java.util.Date d,
CounterValue value)
Counter value setter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected CounterValue counter
protected java.util.Date samplingTime
protected java.util.Date startDate
Constructor Detail |
---|
protected SimpleCounter(java.util.Date startDate, CounterValue.CounterType type)
startDate
- Method Detail |
---|
public static ICounter createCounter(java.util.Date startDate, CounterValue.CounterType type)
startDate
-
public static ICounter createCounter(ICounter copy)
startDate
-
protected void init(java.util.Date startDate, CounterValue.CounterType type)
public void increment()
increment
in interface ICounter
public void increment(java.util.Date d, long delta)
ICounter
increment
in interface ICounter
public void setCounter(java.util.Date d, CounterValue value)
ICounter
setCounter
in interface ICounter
public CounterValue getCounterValue()
getCounterValue
in interface ICounter
public java.util.Date getCounterDate()
getCounterDate
in interface ICounter
public void reset(java.util.Date startDate)
reset
in interface ICounter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |