Class MetricScheduleService

java.lang.Object
com.espertech.esper.common.internal.metrics.stmtmetrics.MetricScheduleService
All Implemented Interfaces:
MetricTimeSource

public final class MetricScheduleService extends Object implements MetricTimeSource
Scheduling for metrics execution is handles=d by this service.
  • 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 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(Collection<MetricExec> handles)
      Evaluate the schedule and populates executions, if any.
      Parameters:
      handles - to populate
    • getNearestTime

      public 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