Package org.apache.bookkeeper.stats
Class CachingStatsLogger
java.lang.Object
org.apache.bookkeeper.stats.CachingStatsLogger
- All Implemented Interfaces:
StatsLogger
A
StatsLogger that caches the stats objects created by other StatsLogger.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ConcurrentMap<String,Counter> protected final ConcurrentMap<String,OpStatsLogger> protected final ConcurrentMap<String,StatsLogger> protected final StatsLogger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetCounter(String name) getOpStatsLogger(String name) getThreadScopedCounter(String name) Thread-scoped stats not currently supported.Thread-scoped stats not currently supported.inthashCode()<T extends Number>
voidregisterGauge(String name, Gauge<T> gauge) Register given gauge as name name.voidremoveScope(String name, StatsLogger statsLogger) Remove the given statsLogger for scope name.Provide the stats logger under scope name.toString()<T extends Number>
voidunregisterGauge(String name, Gauge<T> gauge) Unregister given gauge from name name.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.bookkeeper.stats.StatsLogger
scopeLabel
-
Field Details
-
underlying
-
counters
-
opStatsLoggers
-
scopeStatsLoggers
-
-
Constructor Details
-
CachingStatsLogger
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
toString
-
getOpStatsLogger
- Specified by:
getOpStatsLoggerin interfaceStatsLogger- Parameters:
name- Stats Name- Returns:
- Get the logger for an OpStat described by the name.
-
getCounter
- Specified by:
getCounterin interfaceStatsLogger- Parameters:
name- Stats Name- Returns:
- Get the logger for a simple stat described by the name
-
registerGauge
Description copied from interface:StatsLoggerRegister given gauge as name name.- Specified by:
registerGaugein interfaceStatsLogger- Parameters:
name- gauge namegauge- gauge function
-
unregisterGauge
Description copied from interface:StatsLoggerUnregister given gauge from name name.- Specified by:
unregisterGaugein interfaceStatsLogger- Parameters:
name- name of the gaugegauge- gauge function
-
scope
Description copied from interface:StatsLoggerProvide the stats logger under scope name.- Specified by:
scopein interfaceStatsLogger- Parameters:
name- scope name.- Returns:
- stats logger under scope name.
-
removeScope
Description copied from interface:StatsLoggerRemove the given statsLogger for scope name. It can be no-op if the underlying stats provider doesn't have the ability to remove scope.- Specified by:
removeScopein interfaceStatsLogger- Parameters:
name- name of the scopestatsLogger- the stats logger of this scope.
-
getThreadScopedOpStatsLogger
Thread-scoped stats not currently supported.- Specified by:
getThreadScopedOpStatsLoggerin interfaceStatsLogger- Parameters:
name- Stats Name- Returns:
- Get the logger for an OpStat described by the name with extra labels for the threadpool/threadname and thread no. Lone threads always have 0 as their thread no.
-
getThreadScopedCounter
Thread-scoped stats not currently supported.- Specified by:
getThreadScopedCounterin interfaceStatsLogger- Parameters:
name- Stats Name- Returns:
- Get the logger for a simple stat described by the name with extra labels for the threadpool/threadname and thread no. Lone threads always have 0 as their thread no.
-