com.espertech.esper.epl.metric
Class MetricScheduleService

java.lang.Object
  extended by com.espertech.esper.epl.metric.MetricScheduleService
All Implemented Interfaces:
MetricTimeSource

public final class MetricScheduleService
extends java.lang.Object
implements MetricTimeSource

Scheduling for metrics execution is handles=d by this service.


Constructor Summary
MetricScheduleService()
          Constructor.
 
Method Summary
 void add(long afterMSec, MetricExec execution)
          Adds an execution to the schedule.
 void clear()
          Clears the schedule.
 void evaluate(java.util.Collection<MetricExec> handles)
          Evaluate the schedule and populates executions, if any.
 long getCurrentTime()
          Returns current time for metrics reporting.
 java.lang.Long getNearestTime()
          Returns nearest scheduled time.
 void remove(MetricExec metricExec)
          Remove from schedule an execution.
 void setTime(long currentTime)
          Sets current time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetricScheduleService

public MetricScheduleService()
Constructor.

Method Detail

getCurrentTime

public long getCurrentTime()
Description copied from interface: MetricTimeSource
Returns current time for metrics reporting.

Specified by:
getCurrentTime in interface MetricTimeSource
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

public final void add(long afterMSec,
                      MetricExec execution)
Adds an execution to the schedule.

Parameters:
afterMSec - offset to add at
execution - execution to add

evaluate

public final void evaluate(java.util.Collection<MetricExec> handles)
Evaluate the schedule and populates executions, if any.

Parameters:
handles - to populate

getNearestTime

public java.lang.Long getNearestTime()
Returns nearest scheduled time.

Returns:
nearest scheduled time, or null if none/empty schedule.

remove

public void remove(MetricExec metricExec)
Remove from schedule an execution.

Parameters:
metricExec - to remove

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com