Package com.aerospike.client.metrics
Class Counter
java.lang.Object
com.aerospike.client.metrics.Counter
-
Constructor Summary
ConstructorsConstructorDescriptionCounter()A Counter is a container for a namespace-aggregate map of AtomicLong counters -
Method Summary
Modifier and TypeMethodDescriptionlonggetCountByNS(String namespace) Get the counter's count for the provided namespacelonggetTotal()Get the counter's total, which is the sum of the counter across all namespacesvoidIncrement the counter by 1 for the given namespacevoidIncrement the counter by the provided count amount for the given namespace
-
Constructor Details
-
Counter
public Counter()A Counter is a container for a namespace-aggregate map of AtomicLong counters
-
-
Method Details
-
increment
Increment the counter by 1 for the given namespace- Parameters:
ns- - the namespace for the counter
-
increment
Increment the counter by the provided count amount for the given namespace- Parameters:
ns- - the namespace for the countercount- - the amount by which to increment the counter
-
getTotal
public long getTotal()Get the counter's total, which is the sum of the counter across all namespaces- Returns:
- the total
-
getCountByNS
Get the counter's count for the provided namespace- Parameters:
namespace- the namespace for which we want the count- Returns:
- the count for the namespace
-