Metric

object Metric
Companion:
class
class Object
trait Matchable
class Any
Metric.type

Type members

Classlikes

implicit class CounterSyntax[In](counter: Metric[Counter, In, Any])
implicit class GaugeSyntax[In](gauge: Metric[Gauge, In, Any])
implicit class InvariantSyntax[Type, In, Out](self: Metric[Type, In, Out])
object runtime

Core metrics that are updated by the ZIO runtime system.

Core metrics that are updated by the ZIO runtime system.

Types

type Counter[-In] = Metric[Counter, In, Counter]
type Gauge[-In] = Metric[Gauge, In, Gauge]
type Summary[-In] = Metric[Summary, In, Summary]

Value members

Concrete methods

def counter(name: String): Counter[Long]

A counter, which can be incremented by longs.

A counter, which can be incremented by longs.

def counterDouble(name: String): Counter[Double]

A counter, which can be incremented by doubles.

A counter, which can be incremented by doubles.

def counterInt(name: String): Counter[Int]

A counter, which can be incremented by integers.

A counter, which can be incremented by integers.

def frequency(name: String): Frequency[String]

A string histogram metric, which keeps track of the counts of different strings.

A string histogram metric, which keeps track of the counts of different strings.

def fromMetricKey[Type <: MetricKeyType](key: MetricKey[Type]): Metric[Type, In, Out]

Creates a metric from a metric key. This is the primary constructor for zio.Metric.

Creates a metric from a metric key. This is the primary constructor for zio.Metric.

def gauge(name: String): Gauge[Double]

A gauge, which can be set to a value.

A gauge, which can be set to a value.

def histogram(name: String, boundaries: Boundaries): Histogram[Double]

A numeric histogram metric, which keeps track of the count of numbers that fall in bins with the specified boundaries.

A numeric histogram metric, which keeps track of the count of numbers that fall in bins with the specified boundaries.

def succeed[Out](out: => Out): Metric[Unit, Any, Out]

Creates a metric that ignores input and produces constant output.

Creates a metric that ignores input and produces constant output.

def summary(name: String, maxAge: Duration, maxSize: Int, error: Double, quantiles: Chunk[Double]): Summary[Double]

A summary metric.

A summary metric.

def summaryInstant(name: String, maxAge: Duration, maxSize: Int, error: Double, quantiles: Chunk[Double]): Summary[(Double, Instant)]
def timer(name: String, chronoUnit: ChronoUnit): Metric[Histogram, Duration, Histogram]

Creates a timer metric, based on a histogram, which keeps track of durations in the specified unit of time (milliseconds, seconds, etc.). The unit of time will automatically be added to the metric as a tag ("time_unit: milliseconds").

Creates a timer metric, based on a histogram, which keeps track of durations in the specified unit of time (milliseconds, seconds, etc.). The unit of time will automatically be added to the metric as a tag ("time_unit: milliseconds").

Implicits

Implicits

final implicit def CounterSyntax[In](counter: Metric[Counter, In, Any]): CounterSyntax[In]
final implicit def GaugeSyntax[In](gauge: Metric[Gauge, In, Any]): GaugeSyntax[In]
final implicit def InvariantSyntax[Type, In, Out](self: Metric[Type, In, Out]): InvariantSyntax[Type, In, Out]