Package org.apache.bookkeeper.stats
Interface StatsLogger
- All Known Implementing Classes:
BroadCastStatsLogger.MasterSlave,BroadCastStatsLogger.Two,CachingStatsLogger,CodahaleStatsLogger,FastCodahaleStatsLogger,NullStatsLogger,OtelStatsLogger,PrometheusStatsLogger
public interface StatsLogger
A simple interface that exposes just 2 useful methods. One to get the logger for an Op stat
and another to get the logger for a simple stat
-
Method Summary
Modifier and TypeMethodDescriptiongetCounter(String name) getOpStatsLogger(String name) getThreadScopedCounter(String name) <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.default StatsLoggerscopeLabel(String labelName, String labelValue) Provide the stats logger with an attached label.<T extends Number>
voidunregisterGauge(String name, Gauge<T> gauge) Unregister given gauge from name name.
-
Method Details
-
getOpStatsLogger
- Parameters:
name- Stats Name- Returns:
- Get the logger for an OpStat described by the name.
-
getThreadScopedOpStatsLogger
- 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.
-
getCounter
- Parameters:
name- Stats Name- Returns:
- Get the logger for a simple stat described by the name
-
getThreadScopedCounter
- 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.
-
registerGauge
Register given gauge as name name.- Parameters:
name- gauge namegauge- gauge function
-
unregisterGauge
Unregister given gauge from name name.- Parameters:
name- name of the gaugegauge- gauge function
-
scope
Provide the stats logger under scope name.- Parameters:
name- scope name.- Returns:
- stats logger under scope name.
-
scopeLabel
Provide the stats logger with an attached label.- Parameters:
labelName- the name of the label.labelValue- the value of the label.- Returns:
- stats logger under scope name.
-
removeScope
Remove the given statsLogger for scope name. It can be no-op if the underlying stats provider doesn't have the ability to remove scope.- Parameters:
name- name of the scopestatsLogger- the stats logger of this scope.
-