com.twitter.ostrich.stats

StatsProvider

trait StatsProvider extends AnyRef

Trait for anything that collects counters, timings, and gauges, and can report them in name/value maps.

Many helper methods are provided, with default implementations that just call back into the abstract methods, so a concrete implementation only needs to fill in the abstract methods.

To recap the README:

- counter: a value that never decreases (like "exceptions" or "completed_transactions") - gauge: a discrete instantaneous value (like "heap_used" or "current_temperature") - metric: a distribution (min, max, median, 99th percentile, ...) like "event_timing" - label: an instantaneous informational string for debugging or status checking

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. StatsProvider
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def addGauge(name: String)(gauge: ⇒ Double): Unit

    Add a gauge function, which is used to sample instantaneous values.

  2. abstract def clearAll(): Unit

    Reset all collected stats and erase the history.

    Reset all collected stats and erase the history. Probably only useful for unit tests.

  3. abstract def clearGauge(name: String): Unit

    Remove a gauge from the provided stats.

  4. abstract def clearLabel(name: String): Unit

    Clear an existing label.

  5. abstract def getCounter(name: String): Counter

    Get the Counter object representing a named counter.

  6. abstract def getCounters(): Map[String, Long]

    Summarize all the counters in this collection.

  7. abstract def getGauge(name: String): Option[Double]

    Get the current value of a named gauge.

  8. abstract def getGauges(): Map[String, Double]

    Summarize all the gauges in this collection.

  9. abstract def getLabel(name: String): Option[String]

    Get the current value of a named label, if it exists.

  10. abstract def getLabels(): Map[String, String]

    Summarize all the labels in this collection.

  11. abstract def getMetric(name: String): Metric

    Get the Metric object representing a named metric.

  12. abstract def getMetrics(): Map[String, Distribution]

    Summarize all the metrics in this collection.

  13. abstract def setLabel(name: String, value: String): Unit

    Set a label to a string.

Concrete Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def addMetric(name: String, distribution: Distribution): Unit

    Adds a set of values to a named metric.

    Adds a set of values to a named metric. Effectively the incoming distribution is merged with the named metric.

  7. def addMetric(name: String, value: Int): Unit

    Adds a value to a named metric, which tracks min, max, mean, and a histogram.

  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. final def eq(arg0: AnyRef): Boolean

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. def get(): StatsSummary

    Summarize all the counters, metrics, gauges, and labels in this collection.

  14. final def getClass(): Class[_]

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

    Definition Classes
    AnyRef → Any
  16. def incr(name: String): Long

    Increments a counter by one, returning the new value.

  17. def incr(name: String, count: Int): Long

    Increments a counter, returning the new value.

  18. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  19. val log: Logger

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

    Definition Classes
    AnyRef
  21. final def notify(): Unit

    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  23. def setGauge(name: String, value: Double): Unit

    Set a gauge to a specific value.

    Set a gauge to a specific value. This overwrites any previous value or function.

  24. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  25. def time[T](name: String)(f: ⇒ T): T

    Runs the function f and logs that duration, in milliseconds, with the given name.

  26. def timeFutureMicros[T](name: String)(f: Future[T]): Future[T]

    Runs the function f and logs that duration until the future is satisfied, in microseconds, with the given name.

  27. def timeFutureMillisLazy[T](name: String)(f: ⇒ Future[T]): Future[T]

    Lazily runs the Future that f returns and measure the duration of Future creation and time until it is satisfied, in milliseconds, with the given name

  28. def timeFutureNanos[T](name: String)(f: Future[T]): Future[T]

    Runs the function f and logs that duration until the future is satisfied, in nanoseconds, with the given name.

  29. def timeMicros[T](name: String)(f: ⇒ T): T

    Runs the function f and logs that duration, in microseconds, with the given name.

  30. def timeNanos[T](name: String)(f: ⇒ T): T

    Runs the function f and logs that duration, in nanoseconds, with the given name.

  31. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def timeFutureMillis[T](name: String)(f: Future[T]): Future[T]

    Runs the function f and logs that duration until the future is satisfied, in milliseconds, with the given name.

    Runs the function f and logs that duration until the future is satisfied, in milliseconds, with the given name.

    Annotations
    @deprecated
    Deprecated

    Use timeFutureMillisLazy instead

Inherited from AnyRef

Inherited from Any

Ungrouped