java.lang.Object
com.codahale.metrics.Meter
com.inductiveautomation.ignition.gateway.historian.metric.ProjectedMeter
All Implemented Interfaces:
com.codahale.metrics.Counting, com.codahale.metrics.Metered, com.codahale.metrics.Metric

public class ProjectedMeter extends com.codahale.metrics.Meter
Projects rates by extrapolating from processing duration of event batches.

Unlike a standard Meter which measures actual throughput over wall clock time, this meter projects theoretical throughput by extrapolating from processing duration. For example, if 100 events took 50 ms to process, a rate of 2000 events/second will be projected.

This provides insight into theoretical processing capacity rather than actual achieved throughput.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new ProjectedMeter.
    ProjectedMeter(com.codahale.metrics.Clock clock)
    Creates a new ProjectedMeter.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Returns the mean rate of events per second based on the total processing time.
    void
     
    void
    mark(long n)
     
    void
    mark(long events, long durationNanos)
    Records events and projects their rate based on processing duration.

    Methods inherited from class com.codahale.metrics.Meter

    getCount, getFifteenMinuteRate, getFiveMinuteRate, getOneMinuteRate

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ProjectedMeter

      public ProjectedMeter()
      Creates a new ProjectedMeter.
    • ProjectedMeter

      public ProjectedMeter(com.codahale.metrics.Clock clock)
      Creates a new ProjectedMeter.
      Parameters:
      clock - the clock to use for the meter ticks
  • Method Details

    • mark

      public void mark(long events, long durationNanos)
      Records events and projects their rate based on processing duration.

      Projects rate as: (events * NANOS_PER_SECOND) / durationNanos
      Parameters:
      events - the number of events processed
      durationNanos - the actual time taken to process these events
    • mark

      public void mark()
      Overrides:
      mark in class com.codahale.metrics.Meter
    • mark

      public void mark(long n)
      Overrides:
      mark in class com.codahale.metrics.Meter
    • getMeanRate

      public double getMeanRate()
      Returns the mean rate of events per second based on the total processing time.
      Specified by:
      getMeanRate in interface com.codahale.metrics.Metered
      Overrides:
      getMeanRate in class com.codahale.metrics.Meter