Package

com.twitter.ostrich

stats

Permalink

package stats

Visibility
  1. Public
  2. All

Type Members

  1. class Counter extends AnyRef

    Permalink

    A Counter simply keeps track of how many times an event occurred.

    A Counter simply keeps track of how many times an event occurred. All operations are atomic and thread-safe.

  2. case class Distribution(histogram: Histogram) extends JsonSerializable with Product with Serializable

    Permalink

    A set of data points summarized into a histogram, mean, min, and max.

    A set of data points summarized into a histogram, mean, min, and max. Distributions are immutable.

  3. class FanoutCounter extends Counter

    Permalink

    A Counter that sends modifications to a set of "fanout" counters also.

  4. class FanoutMetric extends Metric

    Permalink
  5. class FanoutStatsCollection extends StatsCollection

    Permalink

    A StatsCollection that sends counter and metric updates to a set of other (fanout) collections.

  6. class GraphiteStatsLogger extends PeriodicBackgroundProcess

    Permalink

    Log all collected stats to Graphite

  7. class GraphiteStatsLoggerFactory extends StatsReporterFactory

    Permalink
  8. class Histogram extends AnyRef

    Permalink
  9. class JsonStatsLogger extends PeriodicBackgroundProcess

    Permalink

    Log all collected stats as a json line to a java logger at a regular interval.

  10. class LatchedStatsListener extends StatsListener

    Permalink

    A StatsListener that cycles over a given period, and once each period, grabs a snapshot of the given StatsCollection and computes deltas since the previous timeslice.

    A StatsListener that cycles over a given period, and once each period, grabs a snapshot of the given StatsCollection and computes deltas since the previous timeslice. For example, for a one-minute period, it grabs a snapshot of stats at the top of each minute, and for the rest of the minute, reports these "latched" stats.

  11. class LocalStatsCollection extends FanoutStatsCollection

    Permalink

    A StatsCollection that sends counter and metric updates to the global Stats object as they happen, and can be asked to flush its stats back into another StatsCollection with a prefix.

    A StatsCollection that sends counter and metric updates to the global Stats object as they happen, and can be asked to flush its stats back into another StatsCollection with a prefix.

    For example, if the prefix is "transaction10", then updating a counter "exceptions" will update this collection and Stats simultaneously for "exceptions". When/if the collection is flushed into Stats at the end of the transaction, "transaction10.exceptions" will be updated with this collection's "exception" count.

  12. class Metric extends AnyRef

    Permalink

    A Metric collates data points and can report a Distribution.

  13. class StatsCollection extends StatsProvider with JsonSerializable

    Permalink

    Concrete StatsProvider that tracks counters and timings.

  14. class StatsListener extends AnyRef

    Permalink

    Attaches to a StatsCollection and reports on all the counters, metrics, gauges, and labels.

    Attaches to a StatsCollection and reports on all the counters, metrics, gauges, and labels. Each report resets state, so counters are reported as deltas, and metrics distributions are only tracked since the last report.

  15. trait StatsProvider extends AnyRef

    Permalink

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

    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

  16. case class StatsSummary(counters: Map[String, Long], metrics: Map[String, Distribution], gauges: Map[String, Double], labels: Map[String, String]) extends Product with Serializable

    Permalink

    Immutable summary of counters, metrics, gauges, and labels.

  17. trait TransactionalStatsCollection extends AnyRef

    Permalink

    Coalesce all events (counters, timings, etc.) that happen in this thread within this transaction, and log them as a single unit at the end.

    Coalesce all events (counters, timings, etc.) that happen in this thread within this transaction, and log them as a single unit at the end. This is useful for logging everything that happens within an HTTP request/response cycle, or similar.

  18. class W3CStats extends TransactionalStatsCollection

    Permalink

    Dump "w3c" style stats to a logger.

    Dump "w3c" style stats to a logger.

    This may be used as a periodic dump (by calling write directly) or to dump stats within a work unit, using the TransactionalStatsCollection API.

  19. class W3CStatsLogger extends PeriodicBackgroundProcess

    Permalink

    Log all collected w3c stats at a regular interval.

  20. class GraphiteStatsLoggerConfig extends StatsReporterConfig

    Permalink

    Write stats to Graphite.

    Write stats to Graphite. Both a prefix and/or a service name can be provided to be appended to the front of the metric keys.

    Annotations
    @deprecated
    Deprecated

    use GraphiteStatsLoggerFactory

Value Members

  1. object DevNullStats extends StatsProvider

    Permalink

    A StatsProvider that doesn't actually save or report anything.

  2. object Histogram

    Permalink
  3. object LocalStatsCollection

    Permalink

    Get the StatsCollection for your "local state".

    Get the StatsCollection for your "local state".

    See also

    Future, Local (from twitter-util) A LocalStatsCollection is associated with a name, which will be used as the prefix when flushing the local counters and metrics back into the global Stats. Because it's stored in a Local, a collection can be looked up several times and return the same object, as long as it's in the same "flow of execution" (as defined by Future). Counters and metrics that are updated on a LocalStatsCollection are also updated on the global Stats object, using the same names. When flushed, these counters and metrics are saved into the global Stats with the collection's name as a prefix.

  4. object Stats extends StatsCollection

    Permalink

    Singleton StatsCollector that collects performance data for the application.

  5. object StatsListener

    Permalink

Deprecated Value Members

  1. object ThreadLocalStatsCollection

    Permalink

    Get a StatsCollection specific to this thread.

    Get a StatsCollection specific to this thread.

    Deprecated

    use LocalStatsCollection instead

Ungrouped