Trait/Object

com.twitter.finagle.stats

StatsReceiver

Related Docs: object StatsReceiver | package stats

Permalink

trait StatsReceiver extends AnyRef

An interface for recording metrics. Named Counters, Stats, and Gauges can be accessed through the corresponding methods of this class.

Verbosity Levels

Each metric created via a stats receiver has a verbosity level attached to it. Distinguishing verbosity levels for metrics is optional and is up to a concrete implementation. Doing this, however, helps to separate debug metrics (only helpful in troubleshooting) from their operationally-required counterparts (provide a corresponding degree of visibility into a healthy process) thus potentially reducing the observability cost.

Metrics created w/o an explicitly specified Verbosity level, will use Verbosity.Default. Use VerbosityAdjustingStatsReceiver to adjust this behaviour.

See also

StatsReceivers for a Java-friendly API.

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. StatsReceiver
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def addGauge(verbosity: Verbosity, name: String*)(f: ⇒ Float): Gauge

    Permalink

    Add the function f as a gauge with the given name.

    Add the function f as a gauge with the given name.

    The returned gauge value is only weakly referenced by the StatsReceiver, and if garbage collected will eventually cease to be a part of this measurement: thus, it needs to be retained by the caller. Or put another way, the measurement is only guaranteed to exist as long as there exists a strong reference to the returned gauge and typically should be stored in a member variable.

    Measurements under the same name are added together.

    See also

    java.lang.ref.WeakReference

    StatsReceiver.provideGauge when there is not a good location to store the returned gauge that can give the desired lifecycle.

  2. abstract def counter(verbosity: Verbosity, name: String*): Counter

    Permalink

    Get a counter with the given name.

    Get a counter with the given name.

    Annotations
    @varargs()
  3. abstract def repr: AnyRef

    Permalink

    Specifies the representative receiver.

    Specifies the representative receiver. This is in order to expose an object we can use for comparison so that global stats are only reported once per receiver.

  4. abstract def stat(verbosity: Verbosity, name: String*): Stat

    Permalink

    Get a stat with the given name.

    Get a stat with the given name.

    Annotations
    @varargs()

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def addGauge(name: String*)(f: ⇒ Float): Gauge

    Permalink

    Add the function f as a gauge with the given name.

    Add the function f as a gauge with the given name.

    The returned gauge value is only weakly referenced by the StatsReceiver, and if garbage collected will eventually cease to be a part of this measurement: thus, it needs to be retained by the caller. Or put another way, the measurement is only guaranteed to exist as long as there exists a strong reference to the returned gauge and typically should be stored in a member variable.

    Measurements under the same name are added together.

    See also

    java.lang.ref.WeakReference

    StatsReceiver.provideGauge when there is not a good location to store the returned gauge that can give the desired lifecycle.

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def counter(name: String*): Counter

    Permalink

    Get a counter with the given name.

    Get a counter with the given name.

    Annotations
    @varargs()
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  14. def isNull: Boolean

    Permalink

    Accurately indicates if this is a NullStatsReceiver.

    Accurately indicates if this is a NullStatsReceiver. Because equality is not forwarded via scala.Proxy, this is helpful to check for a NullStatsReceiver.

  15. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. def provideGauge(name: String*)(f: ⇒ Float): Unit

    Permalink

    Register a function f as a gauge with the given name that has a lifecycle with no end.

    Register a function f as a gauge with the given name that has a lifecycle with no end.

    This measurement exists in perpetuity.

    Measurements under the same name are added together.

    See also

    StatsReceiver.addGauge if you can properly control the lifecycle of the returned gauge.

  19. final def scope(namespaces: String*): StatsReceiver

    Permalink

    Prepend namespace and namespaces to the names of the returned StatsReceiver.

    Prepend namespace and namespaces to the names of the returned StatsReceiver.

    For example:

    statsReceiver.scope("client", "backend", "pool").counter("adds")

    will generate a counter named /client/backend/pool/adds.

    Annotations
    @varargs()
  20. def scope(namespace: String): StatsReceiver

    Permalink

    Prepend namespace to the names of the returned StatsReceiver.

    Prepend namespace to the names of the returned StatsReceiver.

    For example:

    statsReceiver.scope("client").counter("adds")
    statsReceiver.scope("client").scope("backend").counter("adds")

    will generate counters named /client/adds and /client/backend/adds.

  21. def scopeSuffix(suffix: String): StatsReceiver

    Permalink

    Prepend a suffix value to the next scope.

    Prepend a suffix value to the next scope.

    For example:

    statsReceiver.scopeSuffix("toto").scope("client").counter("adds")

    will generate a counter named /client/toto/adds.

  22. def stat(name: String*): Stat

    Permalink

    Get a stat with the given name.

    Get a stat with the given name.

    Annotations
    @varargs()
  23. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  24. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  25. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def counter0(name: String): Counter

    Permalink

    Get a counter with the given name.

    Get a counter with the given name.

    This method is a convenience for Java programs, but is no longer needed because StatsReceivers.counter is usable from java.

    Annotations
    @deprecated
    Deprecated

    (Since version 2017-6-16) Use vararg counter() instead

  2. def stat0(name: String): Stat

    Permalink

    Get a stat with the given name.

    Get a stat with the given name. This method is a convenience for Java programs, but is no longer needed because StatsReceivers.counter is usable from java.

    Annotations
    @deprecated
    Deprecated

    (Since version 2017-6-16) Use vararg stat() instead

Inherited from AnyRef

Inherited from Any

Ungrouped