Package org.xbib.metrics.common
Class CountMetric
- java.lang.Object
-
- org.xbib.metrics.common.CountMetric
-
- All Implemented Interfaces:
org.xbib.metrics.api.Count,org.xbib.metrics.api.Metric
public class CountMetric extends java.lang.Object implements org.xbib.metrics.api.Metric, org.xbib.metrics.api.CountAn incrementing and decrementing counter metric.
-
-
Constructor Summary
Constructors Constructor Description CountMetric()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddec()Decrement the counter by one.voiddec(long n)Decrement the counter byn.voiddec(java.lang.String index, java.lang.String type, java.lang.String id)longgetCount()Returns the counter's current value.java.lang.StringgetDecChecksum(java.lang.String index, java.lang.String type)java.lang.StringgetIncChecksum(java.lang.String index, java.lang.String type)voidinc()Increment the counter by one.voidinc(long n)Increment the counter byn.voidinc(java.lang.String index, java.lang.String type, java.lang.String id)
-
-
-
Method Detail
-
inc
public void inc()
Increment the counter by one.- Specified by:
incin interfaceorg.xbib.metrics.api.Count
-
inc
public void inc(long n)
Increment the counter byn.- Specified by:
incin interfaceorg.xbib.metrics.api.Count- Parameters:
n- the amount by which the counter will be increased
-
inc
public void inc(java.lang.String index, java.lang.String type, java.lang.String id)- Specified by:
incin interfaceorg.xbib.metrics.api.Count
-
dec
public void dec()
Decrement the counter by one.- Specified by:
decin interfaceorg.xbib.metrics.api.Count
-
dec
public void dec(long n)
Decrement the counter byn.- Specified by:
decin interfaceorg.xbib.metrics.api.Count- Parameters:
n- the amount by which the counter will be decreased
-
dec
public void dec(java.lang.String index, java.lang.String type, java.lang.String id)- Specified by:
decin interfaceorg.xbib.metrics.api.Count
-
getCount
public long getCount()
Returns the counter's current value.- Specified by:
getCountin interfaceorg.xbib.metrics.api.Count- Returns:
- the counter's current value
-
getIncChecksum
public java.lang.String getIncChecksum(java.lang.String index, java.lang.String type)- Specified by:
getIncChecksumin interfaceorg.xbib.metrics.api.Count
-
getDecChecksum
public java.lang.String getDecChecksum(java.lang.String index, java.lang.String type)- Specified by:
getDecChecksumin interfaceorg.xbib.metrics.api.Count
-
-