ustats
package ustats
Default global stats collector.
- Alphabetic
- By Inheritance
- ustats
- Probing
- Stats
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- trait BucketDistribution extends AnyRef
- final class Counter extends AnyVal
A counter may only ever be increased (or reset when the application restarts).
- final class Gauge extends AnyVal
Gauges may be increased and decreased.
- class Histogram extends AnyRef
- class ProbeFailedException extends Exception
- trait Probing extends AnyRef
- class Stats extends AnyRef
A memory-efficient, concurrent-friendly metrics collection interface.
Value Members
- def addMetric(name: String): DoubleAdder
Add a metric manually.
Add a metric manually.
This is a low-level escape hatch that should be used only when no other functions apply.
- Definition Classes
- Stats
- def counter(labels: (String, Any)*)(implicit name: Name): Counter
Create and register a counter whose name is automatically derived from the val it is assigned to (plus a global prefix, if set).
Create and register a counter whose name is automatically derived from the val it is assigned to (plus a global prefix, if set).
E.g.
val myFirstStatistic: stats.Counter = stats.counter("foo" -> "bar")
will create a new counter whose metrics will be exposed as
my_first_statistic{foo="bar"}
- Definition Classes
- Stats
- def gauge(labels: (String, Any)*)(implicit name: Name): Gauge
- Definition Classes
- Stats
- def histogram(labels: (String, Any)*)(implicit name: Name): Histogram
- Definition Classes
- Stats
- def histogram(buckets: BucketDistribution, labels: (String, Any)*)(implicit name: Name): Histogram
- Definition Classes
- Stats
- def info(properties: (String, Any)*): Unit
A pseudo-metric used to expose application information in labels.
A pseudo-metric used to expose application information in labels.
E.g.
info("version" -> "0.1.0", "commit" -> "deadbeef")
will create the metric
build_info{version="0.1.0", commit="deadbeef"} 1.0
Note that the actual value will always be 1.
- Definition Classes
- Stats
- def metrics: String
Show metrics as they are right now.
Show metrics as they are right now.
See also writeMetricsTo() for a note on consistency.
- Definition Classes
- Stats
- def namedCounter(name: String, labels: (String, Any)*): Counter
Create and register counter with a given name and labels.
Create and register counter with a given name and labels.
The final metrics name will be composed of the passed name plus any labels, according to the prometheus syntax.
- Definition Classes
- Stats
- def namedGauge(name: String, labels: (String, Any)*): Gauge
- Definition Classes
- Stats
- def namedHistogram(name: String, labels: (String, Any)*): Histogram
- Definition Classes
- Stats
- def namedHistogram(name: String, buckets: BucketDistribution, labels: (String, Any)*): Histogram
- Definition Classes
- Stats
- val prefix: String
- Definition Classes
- Stats
- lazy val probeFailureCounter: Option[Counter]
- Definition Classes
- Probing
- lazy val probePool: ScheduledExecutorService
- Definition Classes
- Probing
- def writeMetricsTo(out: OutputStream): Unit
Write metrics as they are right now to the given output stream.
Write metrics as they are right now to the given output stream.
Concurrency note: this method does not block updating metrics while it is called. This can lead to inconsistent reads where, while printing metrics to the output stream, latter metrics are updated to a new value while an old value from a previous metric has already been printed. Nevertheless, these inconsistent reads offer increased performance and are acceptable for two reasons: 1) metrics may only ever be added; they can never be removed 2) atomic reads are not important for the purpose of metrics collection
- Definition Classes
- Stats
- object BucketDistribution
- object Probing
- object probe
- Definition Classes
- Probing
- object Stats
- object util