Class PerfCounter

java.lang.Object
com.ocient.metrics.Metric<Number>
com.ocient.metrics.PerfCounter
All Implemented Interfaces:
Supplier<Number>

public abstract class PerfCounter extends Metric<Number>
  • Method Details

    • longCounter

      public static PerfCounter longCounter(Metric.MetricPath path, PerfCounter.ThreadingModel threadingModel, Metric.DataType dataType, Metric.CounterType counterType, Metric.Units units)
      Creates a new PerfCounter instance for a long value.
      Parameters:
      path - the perf counter path
      threadingModel - the desired Producer-consumer model
      dataType - the data type of this perf counter
      counterType - the counter type of this perf counter
      units - the units of this perf counter
      Returns:
      a new perf counter
    • dummy

      public static PerfCounter dummy()
      Returns a counter that no-ops
    • counterType

      public final Metric.CounterType counterType()
      Specified by:
      counterType in class Metric<Number>
      Returns:
      this perf counter's data Metric.CounterType
    • setValue

      public abstract void setValue(long value)
      Sets the raw internal value of this counter.
      Parameters:
      value - the new value of the counter
    • incValue

      public abstract void incValue(long delta)
      Adds delta to the internal value of this counter.
      Parameters:
      delta - the amount to add
    • decValue

      public void decValue(long delta)
      Subtracts delta from the internal value of this counter.
      Parameters:
      delta - the amount to subtract