public class CounterGroup extends Group
Modifier and Type | Field and Description |
---|---|
private boolean |
resetCounter |
private Map<String,Counter> |
subEvents |
Constructor and Description |
---|
CounterGroup(String name,
Statistics manager) |
CounterGroup(String name,
Statistics manager,
boolean fetchParametersFromConfig)
Create a basic group of counter which may or may not depend on config.
|
CounterGroup(String name,
Statistics manager,
boolean fetchParametersFromConfig,
Callback callback,
boolean resetCounter)
Create a group of counters with a callback included.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
(package private) Counter |
getCounter(String name)
Get a counter with a given name, creates a new counter if no
counter with the name given exists.
|
private Counter |
getNewCounter(String subName) |
private static boolean |
getResetCounter(String name,
com.yahoo.container.StatisticsConfig config) |
int |
hashCode() |
void |
increment(String name)
Increment named contained counter by 1.
|
void |
increment(String name,
long n)
Increment named contained counter by n.
|
void |
runHandle()
Dump contained counters to log and reset.
|
cancel, getName, isCancelled, makeTask, run, runCallback
public CounterGroup(String name, Statistics manager)
name
- The symbolic name of this group of counters.public CounterGroup(String name, Statistics manager, boolean fetchParametersFromConfig)
name
- The symbolic name of this group of counters.manager
- the statistics manager acquired by injectionfetchParametersFromConfig
- Whether this Group should be configured from config.public CounterGroup(String name, Statistics manager, boolean fetchParametersFromConfig, Callback callback, boolean resetCounter)
name
- The symbolic name of this group of counters.manager
- the statistics manager acquired by injectionfetchParametersFromConfig
- Whether this Group should be configured from config.callback
- will be invoked each time data is written to the logresetCounter
- Control for if this group should be reset between each
logging interval.private static boolean getResetCounter(String name, com.yahoo.container.StatisticsConfig config)
public void increment(String name)
public void increment(String name, long n)
Counter getCounter(String name)
public void runHandle()
Copyright © 2018. All rights reserved.