Package com.ocient.metrics
Class PerfCounter
public abstract class PerfCounter extends Metric<Number>
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPerfCounter.ThreadingModelThreading model under which the counter will be mutatedNested 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.CounterTypecounterType()voiddecValue(long delta)Subtractsdeltafrom the internal value of this counter.static PerfCounterdummy()Returns a counter that no-opsabstract voidincValue(long delta)Addsdeltato the internal value of this counter.static PerfCounterlongCounter(Metric.MetricPath path, PerfCounter.ThreadingModel threadingModel, Metric.DataType dataType, Metric.CounterType counterType, Metric.Units units)Creates a newPerfCounterinstance for alongvalue.abstract voidsetValue(long value)Sets the raw internal value of this counter.
-
Method Details
-
longCounter
public static PerfCounter longCounter(Metric.MetricPath path, PerfCounter.ThreadingModel threadingModel, Metric.DataType dataType, Metric.CounterType counterType, Metric.Units units)Creates a newPerfCounterinstance for alongvalue.- Parameters:
path- the perf counter paththreadingModel- the desired Producer-consumer modeldataType- the data type of this perf countercounterType- the counter type of this perf counterunits- the units of this perf counter- Returns:
- a new perf counter
-
dummy
Returns a counter that no-ops -
counterType
- Specified by:
counterTypein classMetric<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)Addsdeltato the internal value of this counter.- Parameters:
delta- the amount to add
-
decValue
public void decValue(long delta)Subtractsdeltafrom the internal value of this counter.- Parameters:
delta- the amount to subtract
-