Class/Object

com.twitter.ostrich.stats

LocalStatsCollection

Related Docs: object LocalStatsCollection | package stats

Permalink

class LocalStatsCollection extends FanoutStatsCollection

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.

Linear Supertypes
FanoutStatsCollection, StatsCollection, JsonSerializable, StatsProvider, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. LocalStatsCollection
  2. FanoutStatsCollection
  3. StatsCollection
  4. JsonSerializable
  5. StatsProvider
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new LocalStatsCollection(collectionName: String)

    Permalink

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)(gauge: ⇒ Double): Unit

    Permalink

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

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

    Definition Classes
    StatsCollectionStatsProvider
  5. def addListener(listener: StatsListener): Unit

    Permalink

    Attach a new StatsListener to this collection.

    Attach a new StatsListener to this collection. Additions to metrics will be passed along to each listener.

    Definition Classes
    StatsCollection
  6. 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.

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

    Permalink

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

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

    Definition Classes
    StatsProvider
  8. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  9. 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.

    Definition Classes
    StatsCollectionStatsProvider
  10. def clearGauge(name: String): Unit

    Permalink

    Remove a gauge from the provided stats.

    Remove a gauge from the provided stats.

    Definition Classes
    StatsCollectionStatsProvider
  11. def clearLabel(name: String): Unit

    Permalink

    Clear an existing label.

    Clear an existing label.

    Definition Classes
    StatsCollectionStatsProvider
  12. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. val counterMap: ConcurrentHashMap[String, Counter]

    Permalink
    Attributes
    protected
    Definition Classes
    StatsCollection
  14. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  16. def fillInJvmCounters(out: Map[String, Long]): Unit

    Permalink
    Definition Classes
    StatsCollection
  17. def fillInJvmGauges(out: Map[String, Double]): Unit

    Permalink

    Use JMX (shudder) to fill in stats about the JVM into a mutable map.

    Use JMX (shudder) to fill in stats about the JVM into a mutable map.

    Definition Classes
    StatsCollection
  18. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. def flush(): Unit

    Permalink

    Flush this collection's counters and metrics into the global Stats object, with each counter and metric name prefixed by this collection's name.

  20. def flushInto(collection: StatsProvider): Unit

    Permalink

    Flush this collection's counters and metrics into another StatsCollection, with each counter and metric name prefixed by this collection's name.

    Flush this collection's counters and metrics into another StatsCollection, with each counter and metric name prefixed by this collection's name. Counters and metrics in this collection will be cleared out. This is not an atomic operation.

  21. val gaugeMap: ConcurrentHashMap[String, () ⇒ Double]

    Permalink
    Attributes
    protected
    Definition Classes
    StatsCollection
  22. def get(): StatsSummary

    Permalink

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

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

    Definition Classes
    StatsProvider
  23. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  24. def getCounter(name: String): Counter

    Permalink

    Get the Counter object representing a named counter.

    Get the Counter object representing a named counter.

    Definition Classes
    StatsCollectionStatsProvider
  25. def getCounters(): HashMap[String, Long]

    Permalink

    Summarize all the counters in this collection.

    Summarize all the counters in this collection.

    Definition Classes
    StatsCollectionStatsProvider
  26. def getGauge(name: String): Option[Double]

    Permalink

    Get the current value of a named gauge.

    Get the current value of a named gauge.

    Definition Classes
    StatsCollectionStatsProvider
  27. def getGauges(): HashMap[String, Double]

    Permalink

    Summarize all the gauges in this collection.

    Summarize all the gauges in this collection.

    Definition Classes
    StatsCollectionStatsProvider
  28. def getLabel(name: String): Option[String]

    Permalink

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

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

    Definition Classes
    StatsCollectionStatsProvider
  29. def getLabels(): Map[String, String]

    Permalink

    Summarize all the labels in this collection.

    Summarize all the labels in this collection.

    Definition Classes
    StatsCollectionStatsProvider
  30. def getMetric(name: String): Metric

    Permalink

    Get the Metric object representing a named metric.

    Get the Metric object representing a named metric.

    Definition Classes
    StatsCollectionStatsProvider
  31. def getMetrics(): HashMap[String, Distribution]

    Permalink

    Summarize all the metrics in this collection.

    Summarize all the metrics in this collection.

    Definition Classes
    StatsCollectionStatsProvider
  32. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  33. var includeJvmStats: Boolean

    Permalink

    Set this to true to have the collection fill in a set of automatic gauges from the JVM.

    Set this to true to have the collection fill in a set of automatic gauges from the JVM.

    Definition Classes
    StatsCollection
  34. def incr(name: String): Long

    Permalink

    Increments a counter by one, returning the new value.

    Increments a counter by one, returning the new value.

    Definition Classes
    StatsProvider
  35. def incr(name: String, count: Int): Long

    Permalink

    Increments a counter, returning the new value.

    Increments a counter, returning the new value.

    Definition Classes
    StatsProvider
  36. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  37. val labelMap: ConcurrentHashMap[String, String]

    Permalink
    Attributes
    protected
    Definition Classes
    StatsCollection
  38. val log: Logger

    Permalink
    Definition Classes
    StatsProvider
  39. def makeCounter(name: String, atomic: AtomicLong): Counter

    Permalink
    Definition Classes
    StatsCollection
  40. val metricMap: ConcurrentHashMap[String, Metric]

    Permalink
    Attributes
    protected
    Definition Classes
    StatsCollection
  41. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  42. def newCounter(name: String): FanoutCounter

    Permalink
    Definition Classes
    FanoutStatsCollectionStatsCollection
  43. def newMetric(name: String): FanoutMetric

    Permalink
    Definition Classes
    FanoutStatsCollectionStatsCollection
  44. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  46. def removeCounter(name: String): Unit

    Permalink
    Definition Classes
    StatsCollection
  47. def removeMetric(name: String): Option[Metric]

    Permalink
    Definition Classes
    StatsCollection
  48. 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.

    Definition Classes
    StatsProvider
  49. def setLabel(name: String, value: String): Unit

    Permalink

    Set a label to a string.

    Set a label to a string.

    Definition Classes
    StatsCollectionStatsProvider
  50. final def synchronized[T0](arg0: ⇒ T0): T0

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

    Permalink

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

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

    Definition Classes
    StatsProvider
  52. 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.

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

    Definition Classes
    StatsProvider
  53. 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

    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

    Definition Classes
    StatsProvider
  54. 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.

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

    Definition Classes
    StatsProvider
  55. def timeMicros[T](name: String)(f: ⇒ T): T

    Permalink

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

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

    Definition Classes
    StatsProvider
  56. def timeNanos[T](name: String)(f: ⇒ T): T

    Permalink

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

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

    Definition Classes
    StatsProvider
  57. def toJson(): String

    Permalink
    Definition Classes
    StatsCollection → JsonSerializable
  58. def toString(): String

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  61. 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.

    Definition Classes
    StatsProvider
    Annotations
    @deprecated
    Deprecated

    Use timeFutureMillisLazy instead

Inherited from FanoutStatsCollection

Inherited from StatsCollection

Inherited from JsonSerializable

Inherited from StatsProvider

Inherited from AnyRef

Inherited from Any

Ungrouped