Package org.apache.bookkeeper.stats
Class CachingStatsProvider
java.lang.Object
org.apache.bookkeeper.stats.CachingStatsProvider
- All Implemented Interfaces:
StatsProvider
A
CachingStatsProvider adds the caching functionality to an existing StatsProvider.
The stats provider will cache the stats objects created by the other StatsProvider to allow
the reusability of stats objects and avoid creating a lot of stats objects.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ConcurrentMap<String,StatsLogger> protected final StatsProvider -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetStatsLogger(String scope) Return the stats logger to a given scope.getStatsName(String... statsComponents) Return the fully qualified stats name comprised of given statsComponents.voidstart(org.apache.commons.configuration2.Configuration conf) Initialize the stats provider by loading the given configuration conf.voidstop()Close the stats provider.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.bookkeeper.stats.StatsProvider
writeAllMetrics
-
Field Details
-
underlying
-
statsLoggers
-
-
Constructor Details
-
CachingStatsProvider
-
-
Method Details
-
start
public void start(org.apache.commons.configuration2.Configuration conf) Description copied from interface:StatsProviderInitialize the stats provider by loading the given configuration conf.- Specified by:
startin interfaceStatsProvider- Parameters:
conf- Configuration to configure the stats provider.
-
stop
public void stop()Description copied from interface:StatsProviderClose the stats provider.- Specified by:
stopin interfaceStatsProvider
-
getStatsLogger
Description copied from interface:StatsProviderReturn the stats logger to a given scope.- Specified by:
getStatsLoggerin interfaceStatsProvider- Parameters:
scope- Scope for the given stats- Returns:
- stats logger for the given scope
-
getStatsName
Description copied from interface:StatsProviderReturn the fully qualified stats name comprised of given statsComponents.- Specified by:
getStatsNamein interfaceStatsProvider- Parameters:
statsComponents- stats components to comprise the fully qualified stats name- Returns:
- the fully qualified stats name
-