Trait

com.twitter.ostrich.stats

StatsProvider

Related Doc: package stats

Permalink

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
Visibility
  1. Public
  2. All

Abstract Value Members

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

    Permalink

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

  2. abstract def clearAll(): Unit

    Permalink

    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

    Permalink

    Remove a gauge from the provided stats.

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

    Permalink

    Clear an existing label.

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

    Permalink

    Get the Counter object representing a named counter.

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

    Permalink

    Summarize all the counters in this collection.

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

    Permalink

    Get the current value of a named gauge.

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

    Permalink

    Summarize all the gauges in this collection.

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

    Permalink

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

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

    Permalink

    Summarize all the labels in this collection.

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

    Permalink

    Get the Metric object representing a named metric.

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

    Permalink

    Summarize all the metrics in this collection.

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

    Permalink

    Set a label to a string.

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 addMetric(name: String, distribution: Distribution): Unit

    Permalink

    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.

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

    Permalink

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

  6. final def asInstanceOf[T0]: T0

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  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. def get(): StatsSummary

    Permalink

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

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

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

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

    Permalink

    Increments a counter by one, returning the new value.

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

    Permalink

    Increments a counter, returning the new value.

  16. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  17. val log: Logger

    Permalink
  18. final def ne(arg0: AnyRef): Boolean

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

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

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

    Permalink

    Set a gauge to a specific value.

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

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

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

    Permalink

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

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

    Permalink

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

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

    Permalink

    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

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

    Permalink

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

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

    Permalink

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

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

    Permalink

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

  29. def toString(): String

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

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

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

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

Deprecated Value Members

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

    Permalink

    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