package stats

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Package Members

  1. package exp

Type Members

  1. abstract class AbstractStatsReceiver extends StatsReceiver
  2. case class BucketAndCount(lowerLimit: Long, upperLimit: Long, count: Int) extends Product with Serializable

    Buckets consist of a lower limit and an upper limit.

    Buckets consist of a lower limit and an upper limit. In histograms, all values that fall inside these limits are counted as the same.

    The lower limit is inclusive and the upper limit is exclusive

    count

    number of data points which landed in that bucket.

  3. class CategorizingExceptionStatsHandler extends ExceptionStatsHandler

    Basic implementation of exception stat recording that allows exceptions to be categorised and optional rollup.

  4. trait CollisionTrackingStatsReceiver extends AnyRef

    A StatsReceiver that provides a linting rule to track metrics that have different underlying names, yet are exported under the same name.

  5. trait Counter extends AnyRef

    A writeable Counter.

    A writeable Counter. Only sums are kept of Counters. An example Counter is "number of requests served".

  6. case class CustomUnit(name: String) extends MetricUnit with Product with Serializable
  7. trait DelegatingStatsReceiver extends AnyRef

    Should be mixed into StatsReceivers that delegate to other StatsReceivers.

  8. class DenylistStatsReceiver extends StatsReceiverProxy

    A denylisting StatsReceiver.

    A denylisting StatsReceiver. If the name for a metric is found to be denylisted, nothing is recorded.

  9. trait ExceptionStatsHandler extends AnyRef

    Exception Stats Recorder.

  10. trait Gauge extends AnyRef

    Exposes the value of a function.

    Exposes the value of a function. For example, one could add a gauge for a computed health metric.

  11. trait HistogramDetail extends AnyRef

    Details of a histogram's data points.

  12. sealed abstract class HistogramFormat extends AnyRef

    A format for when histogram is exported.

    A format for when histogram is exported. A few formats are supported:

    • NoSummary: only percentiles (p50, ..., p9999) are exported
    • ShortSummary: percentiles and count, and sum are exported
    • FullSummary: percentiles, count, sum, avg, min, and max are exported
    • Default: let the exporting sub-system (usually, TwitterServer) decide
  13. sealed trait HistogramFormatter extends AnyRef
  14. class InMemoryStatsReceiver extends StatsReceiver with WithHistogramDetails

    An in-memory implementation of StatsReceiver, which is mostly used for testing.

    An in-memory implementation of StatsReceiver, which is mostly used for testing.

    Note that an InMemoryStatsReceiver does not conflate Seq("a", "b") and Seq("a/b") names no matter how they look when printed.

    val isr = new InMemoryStatsReceiver
    isr.counter("a", "b", "foo")
    isr.counter("a/b", "bar")
    
    isr.print(Console.out) // will print two lines "a/b/foo 0" and "a/b/bar 0"
    
    assert(isr.counters(Seq("a", "b", "foo") == 0)) // ok
    assert(isr.counters(Seq("a", "b", "bar") == 0)) // fail
  15. final class LazyStatsReceiver extends StatsReceiverProxy

    Wraps an underlying StatsReceiver to ensure that derived counters and stats will not start exporting metrics until incr or add is first called on them.

    Wraps an underlying StatsReceiver to ensure that derived counters and stats will not start exporting metrics until incr or add is first called on them.

    This should be used when integrating with tools that create metrics eagerly, but you don't know whether you're going to actually use those metrics or not. One example might be if you're speaking to a remote peer that exposes many endpoints, and you eagerly create metrics for all of those endpoints, but aren't going to use all of the different methods.

    We don't apply this very widely automatically--it can mess with caching, and adds an extra allocation when you construct a new counter or stat, so please be judicious when using it.

    Note

    does not change the way gauges are used, since there isn't a way of modeling whether a gauge is "used" or not.

  16. sealed trait Metadata extends AnyRef
  17. class MetricBuilder extends Metadata

    A builder class used to configure settings and metadata for metrics prior to instantiating them.

    A builder class used to configure settings and metadata for metrics prior to instantiating them. Calling any of the three build methods (counter, gauge, or histogram) will cause the metric to be instantiated in the underlying StatsReceiver.

  18. class MetricTypes extends AnyRef

    Java APIs for MetricBuilder.MetricType

  19. sealed trait MetricUnit extends AnyRef

    Represents the units this metric is measured in.

    Represents the units this metric is measured in.

    Common units for metrics are: Bytes/Kilobytes/Megabytes (for payload size, data written to disk) Milliseconds (for latency, GC durations) Requests (for successes, failures, and requests) Percentage (for CPU Util, Memory Usage)

  20. sealed trait MetricUsageHint extends AnyRef
  21. case class MultiMetadata(schemas: Seq[Metadata]) extends Metadata with Product with Serializable
  22. abstract class NameTranslatingStatsReceiver extends TranslatingStatsReceiver

    A StatsReceiver receiver proxy that translates all counter, stat, and gauge names according to a translate(name: Seq[String]) function.

  23. class NullStatsReceiver extends StatsReceiver

    A no-op StatsReceiver.

    A no-op StatsReceiver. Metrics are not recorded, making this receiver useful in unit tests and as defaults in situations where metrics are not strictly required.

  24. trait ReadableCounter extends Counter

    A variation of Counter that also supports reading of the current value via the apply method.

  25. trait ReadableStat extends Stat

    A variation of Stat that also supports reading of the current time series via the apply method.

  26. case class RelativeNameMarkingStatsReceiver(self: StatsReceiver) extends StatsReceiverProxy with Product with Serializable

    A StatsReceiver receiver proxy that populates relativeName for all counter, stat, and gauge schemas/metadata.

    A StatsReceiver receiver proxy that populates relativeName for all counter, stat, and gauge schemas/metadata.

    self

    The underlying StatsReceiver to which modified schemas are passed

  27. case class RoleConfiguredStatsReceiver(self: StatsReceiver, role: SourceRole, name: Option[String] = None) extends StatsReceiverProxy with Product with Serializable

    A StatsReceiver proxy that configures all counter, stat, and gauge SourceRoles to the passed in "role".

    A StatsReceiver proxy that configures all counter, stat, and gauge SourceRoles to the passed in "role".

    self

    The underlying StatsReceiver to which translated names are passed

    role

    the role used for SourceRole Metadata

  28. class RollupStatsReceiver extends StatsReceiverProxy

    A RollupStatsReceiver reports stats on multiple Counter/Stat/Gauge based on the sequence of names you pass.

    A RollupStatsReceiver reports stats on multiple Counter/Stat/Gauge based on the sequence of names you pass. e.g. counter("errors", "clientErrors", "java_net_ConnectException").incr() will actually increment those three counters: - "/errors" - "/errors/clientErrors" - "/errors/clientErrors/java_net_ConnectException"

  29. sealed abstract class SourceRole extends AnyRef

    Represents the "role" this service plays with respect to this metric.

    Represents the "role" this service plays with respect to this metric.

    Usually either Server (the service is processing a request) or Client (the server has sent a request to another service). In many cases, there is no relevant role for a metric, in which case NoRole should be used.

  30. trait Stat extends AnyRef

    An append-only collection of time-series data.

    An append-only collection of time-series data. Example Stats are "queue depth" or "query width in a stream of requests".

  31. trait StatsReceiver extends AnyRef

    An interface for recording metrics.

    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.

  32. trait StatsReceiverProxy extends StatsReceiver with DelegatingStatsReceiver

    A proxy StatsReceiver that delegates all calls to the self stats receiver.

  33. trait StatsReceiverWithCumulativeGauges extends StatsReceiver
  34. abstract class TranslatingStatsReceiver extends StatsReceiverProxy

    A StatsReceiver receiver proxy that translates all counter, stat, and gauge names according to a translate function.

  35. final class Verbosity extends AnyRef

    Represent a verbosity level for a given metric.

  36. class VerbosityAdjustingStatsReceiver extends StatsReceiverProxy

    A StatsReceiver that adjusts the passed Verbosity of an underlying stats receiver to a given defaultVerbosity.

  37. trait WithHistogramDetails extends AnyRef

    Allow StatsReceivers to provide snapshots of histogram counts.

    Allow StatsReceivers to provide snapshots of histogram counts. Implementations must expose a map where keys are the name of the stat and values are the contents of the histogram.

Value Members

  1. object AggregateWithHistogramDetails
  2. object BroadcastCounter

    BroadcastCounter is a helper object that create a Counter wrapper around multiple Counters (n).

    BroadcastCounter is a helper object that create a Counter wrapper around multiple Counters (n). For performance reason, we have specialized cases if n == (0, 1, 2, 3 or 4)

  3. object BroadcastStat

    BroadcastStat is a helper object that create a Counter wrapper around multiple Stats (n).

    BroadcastStat is a helper object that create a Counter wrapper around multiple Stats (n). For performance reason, we have specialized cases if n == (0, 1, 2, 3 or 4)

  4. object BroadcastStatsReceiver

    BroadcastStatsReceiver is a helper object that create a StatsReceiver wrapper around multiple StatsReceivers (n).

  5. case object Bytes extends MetricUnit with Product with Serializable
  6. object DefaultStatsReceiver extends StatsReceiverProxy

    A "default" StatsReceiver loaded by the com.twitter.finagle.util.LoadService mechanism.

  7. object DelegatingStatsReceiver
  8. object DenylistStatsReceiver
  9. object ExceptionStatsHandler

    API for deciding where request exceptions are reported in stats.

    API for deciding where request exceptions are reported in stats. Typical implementations may report any cancellations or validation errors separately so success rate can from valid non cancelled requests.

    See also

    Null for a no-op handler.

  10. object HistogramFormat
  11. object InMemoryStatsReceiver
  12. object JStats

    Stat utility methods for ease of use from java.

  13. case object Kilobytes extends MetricUnit with Product with Serializable
  14. object LoadedStatsReceiver extends StatsReceiverProxy

    A com.twitter.finagle.stats.StatsReceiver that loads all service-loadable receivers and broadcasts stats to them.

  15. case object Megabytes extends MetricUnit with Product with Serializable
  16. object MetricBuilder
  17. object MetricUsageHint
  18. case object Microseconds extends MetricUnit with Product with Serializable
  19. case object Milliseconds extends MetricUnit with Product with Serializable
  20. object NameTranslatingStatsReceiver
  21. case object NoMetadata extends Metadata with Product with Serializable
  22. object NullStatsReceiver extends NullStatsReceiver
  23. case object Percentage extends MetricUnit with Product with Serializable
  24. case object Requests extends MetricUnit with Product with Serializable
  25. case object Seconds extends MetricUnit with Product with Serializable
  26. object SourceRole
  27. object Stat

    Helpers for working with histograms.

    Helpers for working with histograms.

    Java-friendly versions can be found in com.twitter.finagle.stats.JStats.

  28. object StatsReceiver
  29. case object Unspecified extends MetricUnit with Product with Serializable
  30. object Verbosity
  31. object format extends GlobalFlag[String]
  32. object metadataScopeSeparator

    finagle-stats has configurable scope separators.

    finagle-stats has configurable scope separators. As this package is wrapped by finagle-stats, we cannot retrieve it from finagle-stats. Consequently, we created this object so that the scope-separator can be passed in for stringification of the MetricBuilder objects.

Deprecated Value Members

  1. object StatsReceivers

    StatsReceiver utility methods for ease of use from java.

    StatsReceiver utility methods for ease of use from java.

    Annotations
    @deprecated
    Deprecated

    (Since version 2020-06-10) Use StatsReceiver addGauge and provideGauge methods directly

Ungrouped