Class TimeSeriesCounter.Counter

java.lang.Object
org.elasticsearch.script.TimeSeriesCounter.Counter
Enclosing class:
TimeSeriesCounter

public static class TimeSeriesCounter.Counter extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final long[]
     
    protected int
     
    protected final long
     
    protected final long
     
    protected long
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Counter(long resolution, long duration)
    Create a Counter that covers duration seconds at the given resolution.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    inc(long now)
    Increment the counter at time now, expressed in seconds.
    long
    sum(long now)
    sum for the duration of the counter until now.

    Methods inherited from class java.lang.Object

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

    • resolution

      protected final long resolution
    • duration

      protected final long duration
    • buckets

      protected final long[] buckets
    • startOfCurrentEpoch

      protected long startOfCurrentEpoch
    • curBucket

      protected int curBucket
  • Constructor Details

    • Counter

      public Counter(long resolution, long duration)
      Create a Counter that covers duration seconds at the given resolution. Duration must be divisible by resolution.
  • Method Details

    • inc

      public void inc(long now)
      Increment the counter at time now, expressed in seconds.
    • sum

      public long sum(long now)
      sum for the duration of the counter until now.