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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Counter
getCounter(java.lang.String name)
OpStatsLogger
getOpStatsLogger(java.lang.String name)
Counter
getThreadScopedCounter(java.lang.String name)
OpStatsLogger
getThreadScopedOpStatsLogger(java.lang.String name)
<T extends java.lang.Number>
voidregisterGauge(java.lang.String name, Gauge<T> gauge)
Register given gauge as name name.void
removeScope(java.lang.String name, StatsLogger statsLogger)
Remove the given statsLogger for scope name.StatsLogger
scope(java.lang.String name)
Provide the stats logger under scope name.default StatsLogger
scopeLabel(java.lang.String labelName, java.lang.String labelValue)
Provide the stats logger with an attached label.<T extends java.lang.Number>
voidunregisterGauge(java.lang.String name, Gauge<T> gauge)
Unregister given gauge from name name.
-
-
-
Method Detail
-
getOpStatsLogger
OpStatsLogger getOpStatsLogger(java.lang.String name)
- Parameters:
name
- Stats Name- Returns:
- Get the logger for an OpStat described by the name.
-
getThreadScopedOpStatsLogger
OpStatsLogger getThreadScopedOpStatsLogger(java.lang.String name)
- 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
Counter getCounter(java.lang.String name)
- Parameters:
name
- Stats Name- Returns:
- Get the logger for a simple stat described by the name
-
getThreadScopedCounter
Counter getThreadScopedCounter(java.lang.String name)
- 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
<T extends java.lang.Number> void registerGauge(java.lang.String name, Gauge<T> gauge)
Register given gauge as name name.- Parameters:
name
- gauge namegauge
- gauge function
-
unregisterGauge
<T extends java.lang.Number> void unregisterGauge(java.lang.String name, Gauge<T> gauge)
Unregister given gauge from name name.- Parameters:
name
- name of the gaugegauge
- gauge function
-
scope
StatsLogger scope(java.lang.String name)
Provide the stats logger under scope name.- Parameters:
name
- scope name.- Returns:
- stats logger under scope name.
-
scopeLabel
default StatsLogger scopeLabel(java.lang.String labelName, java.lang.String labelValue)
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
void removeScope(java.lang.String name, StatsLogger statsLogger)
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.
-
-