Class MetricScheduleService
java.lang.Object
com.espertech.esper.common.internal.metrics.stmtmetrics.MetricScheduleService
- All Implemented Interfaces:
MetricTimeSource
Scheduling for metrics execution is handles=d by this service.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
add
(long afterMSec, MetricExec execution) Adds an execution to the schedule.void
clear()
Clears the schedule.final void
evaluate
(Collection<MetricExec> handles) Evaluate the schedule and populates executions, if any.long
Returns current time for metrics reporting.Returns nearest scheduled time.void
remove
(MetricExec metricExec) Remove from schedule an execution.final void
setTime
(long currentTime) Sets current time.
-
Constructor Details
-
MetricScheduleService
public MetricScheduleService()Constructor.
-
-
Method Details
-
getCurrentTime
public long getCurrentTime()Description copied from interface:MetricTimeSource
Returns current time for metrics reporting.- Specified by:
getCurrentTime
in interfaceMetricTimeSource
- Returns:
- metrics current time
-
clear
public void clear()Clears the schedule. -
setTime
public final void setTime(long currentTime) Sets current time.- Parameters:
currentTime
- to set
-
add
Adds an execution to the schedule.- Parameters:
afterMSec
- offset to add atexecution
- execution to add
-
evaluate
Evaluate the schedule and populates executions, if any.- Parameters:
handles
- to populate
-
getNearestTime
Returns nearest scheduled time.- Returns:
- nearest scheduled time, or null if none/empty schedule.
-
remove
Remove from schedule an execution.- Parameters:
metricExec
- to remove
-