com.twitter.ostrich.stats

LocalStatsCollection

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
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new LocalStatsCollection(collectionName: String)

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

    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
  7. def addListener(listener: StatsListener): Unit

    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
  8. 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.

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

    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
  10. final def asInstanceOf[T0]: T0

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

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

    Remove a gauge from the provided stats.

    Remove a gauge from the provided stats.

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

    Clear an existing label.

    Clear an existing label.

    Definition Classes
    StatsCollectionStatsProvider
  14. def clone(): AnyRef

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

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

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

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

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

    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
  20. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  21. def flush(): Unit

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

  22. def flushInto(collection: StatsProvider): Unit

    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.

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

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

    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
  25. final def getClass(): Class[_]

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

    Get the Counter object representing a named counter.

    Get the Counter object representing a named counter.

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

    Summarize all the counters in this collection.

    Summarize all the counters in this collection.

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

    Get the current value of a named gauge.

    Get the current value of a named gauge.

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

    Summarize all the gauges in this collection.

    Summarize all the gauges in this collection.

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

    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
  31. def getLabels(): Map[String, String]

    Summarize all the labels in this collection.

    Summarize all the labels in this collection.

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

    Get the Metric object representing a named metric.

    Get the Metric object representing a named metric.

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

    Summarize all the metrics in this collection.

    Summarize all the metrics in this collection.

    Definition Classes
    StatsCollectionStatsProvider
  34. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  35. var includeJvmStats: Boolean

    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
  36. def incr(name: String): Long

    Increments a counter by one, returning the new value.

    Increments a counter by one, returning the new value.

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

    Increments a counter, returning the new value.

    Increments a counter, returning the new value.

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

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

    Attributes
    protected
    Definition Classes
    StatsCollection
  40. val log: Logger

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

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

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

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

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

    Definition Classes
    FanoutStatsCollectionStatsCollection
  46. final def notify(): Unit

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

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

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

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

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

    Set a label to a string.

    Set a label to a string.

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

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

    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
  54. 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.

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

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

    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
  56. 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.

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

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

    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
  58. def timeNanos[T](name: String)(f: ⇒ T): T

    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
  59. def toJson(): String

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

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

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

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

    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