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 Details

    • getOpStatsLogger

      OpStatsLogger getOpStatsLogger(String name)
      Parameters:
      name - Stats Name
      Returns:
      Get the logger for an OpStat described by the name.
    • getThreadScopedOpStatsLogger

      OpStatsLogger getThreadScopedOpStatsLogger(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(String name)
      Parameters:
      name - Stats Name
      Returns:
      Get the logger for a simple stat described by the name
    • getThreadScopedCounter

      Counter getThreadScopedCounter(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 Number> void registerGauge(String name, Gauge<T> gauge)
      Register given gauge as name name.
      Parameters:
      name - gauge name
      gauge - gauge function
    • unregisterGauge

      <T extends Number> void unregisterGauge(String name, Gauge<T> gauge)
      Unregister given gauge from name name.
      Parameters:
      name - name of the gauge
      gauge - gauge function
    • scope

      StatsLogger scope(String name)
      Provide the stats logger under scope name.
      Parameters:
      name - scope name.
      Returns:
      stats logger under scope name.
    • scopeLabel

      default StatsLogger scopeLabel(String labelName, 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(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 scope
      statsLogger - the stats logger of this scope.