public final class StatisticsImpl extends com.yahoo.component.AbstractComponent implements Statistics
Statistics.NullImplementation
Modifier and Type | Field and Description |
---|---|
private int |
collectioninterval |
private com.yahoo.container.StatisticsConfig |
config |
(package private) Map<String,Handle> |
handles |
private static Logger |
log |
private int |
logginginterval |
private Timer |
worker |
nullImplementation
Constructor and Description |
---|
StatisticsImpl(com.yahoo.container.StatisticsConfig config)
Build a statistics manager based on the given config values.
|
Modifier and Type | Method and Description |
---|---|
void |
deconstruct()
Cancel internal worker thread and do any other necessary cleanup.
|
com.yahoo.container.StatisticsConfig |
getConfig()
Get current config used.
|
int |
purge()
Purges all cancelled Handles from internal Map and Timer.
|
void |
register(Handle h)
Add a new handle to be scheduled for periodic logging.
|
void |
remove(String name)
Remove a named handler from the set of working handlers.
|
private void |
schedule(Handle h) |
private final Timer worker
private final com.yahoo.container.StatisticsConfig config
private static final Logger log
private final int collectioninterval
private final int logginginterval
public StatisticsImpl(com.yahoo.container.StatisticsConfig config)
config
- settings for logging interval and configured events. Setting
it to null disables logging.IllegalArgumentException
- if logging interval is smaller than collection interval, or
collection interval is not a multiplum of logging intervalpublic void deconstruct()
deconstruct
in class com.yahoo.component.AbstractComponent
private void schedule(Handle h)
public void register(Handle h)
register
in interface Statistics
public void remove(String name)
remove
in interface Statistics
public com.yahoo.container.StatisticsConfig getConfig()
getConfig
in interface Statistics
public int purge()
purge
in interface Statistics
Copyright © 2017. All rights reserved.