Packages

c

com.twitter.finagle.stats

InMemoryStatsReceiver

class InMemoryStatsReceiver extends WithHistogramDetails with StatsReceiver

An in-memory implementation of StatsReceiver, which is mostly used for testing.

Note that an InMemoryStatsReceiver does not conflate Seq("a", "b") and Seq("a/b") names no matter how they look when printed.

val isr = new InMemoryStatsReceiver
isr.counter("a", "b", "foo")
isr.counter("a/b", "bar")

isr.print(Console.out) // will print two lines "a/b/foo 0" and "a/b/bar 0"

assert(isr.counters(Seq("a", "b", "foo") == 0)) // ok
assert(isr.counters(Seq("a", "b", "bar") == 0)) // fail
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. InMemoryStatsReceiver
  2. StatsReceiver
  3. WithHistogramDetails
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new InMemoryStatsReceiver()

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addGauge(name: String*)(f: ⇒ Float): Gauge

    Creates a Gauge of the given name.

    Creates a Gauge of the given name.

    Definition Classes
    InMemoryStatsReceiverStatsReceiver
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clear(): Unit

    Clears all registered counters, gauges and stats.

    Clears all registered counters, gauges and stats.

    Note

    this is not atomic. If new metrics are added while this method is executing, those metrics may remain.

  7. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def counter(name: String*): ReadableCounter

    Creates a ReadableCounter of the given name.

    Creates a ReadableCounter of the given name.

    Definition Classes
    InMemoryStatsReceiverStatsReceiver
  9. def counter0(name: String): Counter

    Get a counter with the given name.

    Get a counter with the given name.

    This method is a convenience for Java programs, but is no longer needed because StatsReceivers.counter is usable from java.

    Definition Classes
    StatsReceiver
  10. val counters: Map[Seq[String], Int]
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. val gauges: Map[Seq[String], () ⇒ Float]
  15. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  17. def histogramDetails: Map[String, HistogramDetail]
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. def isNull: Boolean

    Accurately indicates if this is a NullStatsReceiver.

    Accurately indicates if this is a NullStatsReceiver. Because equality is not forwarded via scala.Proxy, this is helpful to check for a NullStatsReceiver.

    Definition Classes
    StatsReceiver
  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 print(p: PrintStream): Unit

    Dumps this in-memory stats receiver to the given PrintStream.

  24. def provideGauge(name: String*)(f: ⇒ Float): Unit

    Register a function f as a gauge with the given name that has a lifecycle with no end.

    Register a function f as a gauge with the given name that has a lifecycle with no end.

    This measurement exists in perpetuity.

    Measurements under the same name are added together.

    Definition Classes
    StatsReceiver
    See also

    StatsReceiver.addGauge if you can properly control the lifecycle of the returned gauge.

  25. val repr: InMemoryStatsReceiver
    Definition Classes
    InMemoryStatsReceiverStatsReceiver
  26. final def scope(namespaces: String*): StatsReceiver

    Prepend namespace and namespaces to the names of the returned StatsReceiver.

    Prepend namespace and namespaces to the names of the returned StatsReceiver.

    For example:

    statsReceiver.scope("client", "backend", "pool").counter("adds")

    will generate a counter named /client/backend/pool/adds.

    Definition Classes
    StatsReceiver
    Annotations
    @varargs()
  27. def scope(namespace: String): StatsReceiver

    Prepend namespace to the names of the returned StatsReceiver.

    Prepend namespace to the names of the returned StatsReceiver.

    For example:

    statsReceiver.scope("client").counter("adds")
    statsReceiver.scope("client").scope("backend").counter("adds")

    will generate counters named /client/adds and /client/backend/adds.

    Definition Classes
    StatsReceiver
  28. def scopeSuffix(suffix: String): StatsReceiver

    Prepend a suffix value to the next scope.

    Prepend a suffix value to the next scope.

    For example:

    statsReceiver.scopeSuffix("toto").scope("client").counter("adds")

    will generate a counter named /client/toto/adds.

    Definition Classes
    StatsReceiver
  29. def stat(name: String*): ReadableStat

    Creates a ReadableStat of the given name.

    Creates a ReadableStat of the given name.

    Definition Classes
    InMemoryStatsReceiverStatsReceiver
  30. def stat0(name: String): Stat

    Get a stat with the given name.

    Get a stat with the given name. This method is a convenience for Java programs, but is no longer needed because StatsReceivers.counter is usable from java.

    Definition Classes
    StatsReceiver
  31. val stats: Map[Seq[String], Seq[Float]]
  32. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  33. def toString(): String
    Definition Classes
    InMemoryStatsReceiver → AnyRef → Any
  34. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from StatsReceiver

Inherited from WithHistogramDetails

Inherited from AnyRef

Inherited from Any

Ungrouped