public enum GlobalMetrics extends java.lang.Enum<GlobalMetrics> implements java.io.Serializable
GlobalMetrics.incr("mycounter")
to add a counter. There will be no need to
explicitly declare the counter before. If the counter doesn't exist it will be created.
The creation is lazy which means, unless the counter not being available, it is counted as 0
CounterFactory.init() should be called in prepare and open methods of bolt and spout respectively.
The counters will be named __auto__/mycounter (note the __auto__ prefix)Enum Constant and Description |
---|
INSTANCE |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ROOT_NAME |
Modifier and Type | Method and Description |
---|---|
static MultiCountMetric |
getUnderlyingCounter()
test-only
|
static void |
incr(java.lang.String counterName)
Not thread safe increment of counterName.
|
static void |
incrBy(java.lang.String counterName,
int N)
Not thread safe 'incrementing by' of counterName.
|
static void |
init(IMetricsRegister metricsRegister,
int metricsBucket)
Initialize the counter by registering the metricContainer.
|
protected java.lang.Object |
readResolve()
During serialization don't create a copy of this class.
|
static void |
safeIncr(java.lang.String counterName)
Thread safe created increment of counterName.
|
static void |
safeIncrBy(java.lang.String counterName,
int N)
Thread safe created increment of counterName.
|
static GlobalMetrics |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static GlobalMetrics[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final GlobalMetrics INSTANCE
public static GlobalMetrics[] values()
for (GlobalMetrics c : GlobalMetrics.values()) System.out.println(c);
public static GlobalMetrics valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static void incr(java.lang.String counterName)
public static void incrBy(java.lang.String counterName, int N)
public static void safeIncr(java.lang.String counterName)
protected java.lang.Object readResolve()
public static void safeIncrBy(java.lang.String counterName, int N)
public static void init(IMetricsRegister metricsRegister, int metricsBucket)
public static MultiCountMetric getUnderlyingCounter()