Package com.ocient.metrics

# 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>

## Nested Class Summary

Nested Classes
Modifier and Type | Class | Description
--- | --- | ---
`static class` | `PerfCounter.ThreadingModel` | Threading model under which the counter will be mutated

## Nested classes/interfaces inherited from class com.ocient.metrics.Metric

`Metric.CounterType, Metric.DataType, Metric.MetricPath, Metric.NamedTag, Metric.Tag, Metric.Units`

## Method Summary

Modifier and Type | Method | Description
--- | --- | ---
`Metric.CounterType` | `counterType()` |
`void` | `decValue​(long delta)` | Subtracts `delta` from the internal value of this counter.
`static PerfCounter` | `dummy()` | Returns a counter that no-ops
`abstract void` | `incValue​(long delta)` | Adds `delta` to the internal value of this counter.
`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.
`abstract void` | `setValue​(long value)` | Sets the raw internal value of this counter.

### Methods inherited from class com.ocient.metrics.Metric

`dataType, path, units`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.util.function.Supplier

`get`

## 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