public final class MetricScheduleService extends Object implements MetricTimeSource
Constructor and Description |
---|
MetricScheduleService()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
add(long afterMSec,
MetricExec execution)
Adds an execution to the schedule.
|
void |
clear()
Clears the schedule.
|
void |
evaluate(Collection<MetricExec> handles)
Evaluate the schedule and populates executions, if any.
|
long |
getCurrentTime()
Returns current time for metrics reporting.
|
Long |
getNearestTime()
Returns nearest scheduled time.
|
void |
remove(MetricExec metricExec)
Remove from schedule an execution.
|
void |
setTime(long currentTime)
Sets current time.
|
public long getCurrentTime()
MetricTimeSource
getCurrentTime
in interface MetricTimeSource
public void clear()
public final void setTime(long currentTime)
currentTime
- to setpublic final void add(long afterMSec, MetricExec execution)
afterMSec
- offset to add atexecution
- execution to addpublic final void evaluate(Collection<MetricExec> handles)
handles
- to populatepublic Long getNearestTime()
public void remove(MetricExec metricExec)
metricExec
- to remove