Trait/Object

zio.metrics

Metric

Related Docs: object Metric | package metrics

Permalink

trait Metric[+Type, -In, +Out] extends ZIOAspect[Nothing, Any, Nothing, Any, Nothing, In]

A Metric[In, Out] represents a concurrent metric, which accepts updates of type In, which are aggregated to a stateful value of type Out.

For example, a counter metric would have type Metric[Double, Double], representing the fact that the metric can be updated with doubles (the amount to increment or decrement the counter by), and the state of the counter is a double.

There are five primitive metric types supported by ZIO:

The companion object contains constructors for these primitive metrics. All metrics are derived from these primitive metrics.

Self Type
Metric[Type, In, Out]
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Metric
  2. ZIOAspect
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract val keyType: Type

    Permalink

    The type of the underlying primitive metric.

    The type of the underlying primitive metric. For example, this could be MetricKeyType.Counter or MetricKeyType.Gauge.

Concrete 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 >>>[LowerR1 >: Nothing, UpperR1 <: Any, LowerE1 >: Nothing, UpperE1 <: Any, LowerA1 >: Nothing, UpperA1 <: In](that: ZIOAspect[LowerR1, UpperR1, LowerE1, UpperE1, LowerA1, UpperA1]): ZIOAspect[LowerR1, UpperR1, LowerE1, UpperE1, LowerA1, UpperA1]

    Permalink
    Definition Classes
    ZIOAspect
  5. def @@[LowerR1 >: Nothing, UpperR1 <: Any, LowerE1 >: Nothing, UpperE1 <: Any, LowerA1 >: Nothing, UpperA1 <: In](that: ZIOAspect[LowerR1, UpperR1, LowerE1, UpperE1, LowerA1, UpperA1]): ZIOAspect[LowerR1, UpperR1, LowerE1, UpperE1, LowerA1, UpperA1]

    Permalink

    Returns a new aspect that represents the sequential composition of this aspect with the specified one.

    Returns a new aspect that represents the sequential composition of this aspect with the specified one.

    Definition Classes
    ZIOAspect
  6. def andThen[LowerR1 >: Nothing, UpperR1 <: Any, LowerE1 >: Nothing, UpperE1 <: Any, LowerA1 >: Nothing, UpperA1 <: In](that: ZIOAspect[LowerR1, UpperR1, LowerE1, UpperE1, LowerA1, UpperA1]): ZIOAspect[LowerR1, UpperR1, LowerE1, UpperE1, LowerA1, UpperA1]

    Permalink
    Definition Classes
    ZIOAspect
  7. final def apply[R, E, A1 <: In](zio: ZIO[R, E, A1])(implicit trace: Trace): ZIO[R, E, A1]

    Permalink

    Applies the metric computation to the result of the specified effect.

    Applies the metric computation to the result of the specified effect.

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

    Permalink
    Definition Classes
    Any
  9. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. final def contramap[In2](f: (In2) ⇒ In): Metric[Type, In2, Out]

    Permalink

    Returns a new metric that is powered by this one, but which accepts updates of the specified new type, which must be transformable to the input type of this metric.

  11. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. def flip: ZIOAspect[Nothing, Any, Nothing, In, Nothing, Any]

    Permalink

    Returns a new aspect that flips the behavior it applies to error and success channels.

    Returns a new aspect that flips the behavior it applies to error and success channels. If the old aspect affected success values in some way, then the new aspect will affect error values in the same way.

    Definition Classes
    ZIOAspect
  15. final def fromConst(in: ⇒ In): Metric[Type, Any, Out]

    Permalink

    Returns a new metric that is powered by this one, but which accepts updates of any type, and translates them to updates with the specified constant update value.

  16. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  17. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  18. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  19. final def map[Out2](f: (Out) ⇒ Out2): Metric[Type, In, Out2]

    Permalink

    Returns a new metric that is powered by this one, but which outputs a new state type, determined by transforming the state type of this metric by the specified function.

  20. final def mapType[Type2](f: (Type) ⇒ Type2): Metric[Type2, In, Out]

    Permalink
  21. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  22. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  24. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  25. final def tagged(extraTags0: Set[MetricLabel]): Metric[Type, In, Out]

    Permalink

    Returns a new metric, which is identical in every way to this one, except the specified tags have been added to the tags of this metric.

  26. final def tagged(extraTag: MetricLabel, extraTags: MetricLabel*): Metric[Type, In, Out]

    Permalink

    Returns a new metric, which is identical in every way to this one, except the specified tags have been added to the tags of this metric.

  27. final def tagged(key: String, value: String): Metric[Type, In, Out]

    Permalink

    Returns a new metric, which is identical in every way to this one, except the specified tag will be added to the tags of this metric.

  28. final def taggedWith[In1 <: In](f: (In1) ⇒ Set[MetricLabel]): Metric[Type, In1, Unit]

    Permalink

    Returns a new metric, which is identical in every way to this one, except dynamic tags are added based on the update values.

    Returns a new metric, which is identical in every way to this one, except dynamic tags are added based on the update values. Note that the metric returned by this method does not return any useful information, due to the dynamic nature of the added tags.

  29. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  30. final def trackAll(in: ⇒ In): ZIOAspect[Nothing, Any, Nothing, Any, Nothing, Any]

    Permalink

    Returns a ZIOAspect that will update this metric with the specified constant value every time the aspect is applied to an effect, regardless of whether that effect fails or succeeds.

  31. final def trackDefect(implicit ev: <:<[Throwable, In]): ZIOAspect[Nothing, Any, Nothing, Throwable, Nothing, Any]

    Permalink

    Returns a ZIOAspect that will update this metric with the throwable defects of the effects that it is applied to.

    Returns a ZIOAspect that will update this metric with the throwable defects of the effects that it is applied to. To call this method, the input type of the metric must be Throwable.

  32. final def trackDefectWith(f: (Throwable) ⇒ In): ZIOAspect[Nothing, Any, Nothing, Throwable, Nothing, Any]

    Permalink

    Returns a ZIOAspect that will update this metric with the result of applying the specified function to the defect throwables of the effects that the aspect is applied to.

  33. final def trackDuration(implicit ev: <:<[zio.Duration, In]): ZIOAspect[Nothing, Any, Nothing, Any, Nothing, Any]

    Permalink

    Returns a ZIOAspect that will update this metric with the duration that the effect takes to execute.

    Returns a ZIOAspect that will update this metric with the duration that the effect takes to execute. To call this method, the input type of the metric must be Duration.

  34. final def trackDurationWith(f: (zio.Duration) ⇒ In): ZIOAspect[Nothing, Any, Nothing, Any, Nothing, Any]

    Permalink

    Returns a ZIOAspect that will update this metric with the duration that the effect takes to execute.

    Returns a ZIOAspect that will update this metric with the duration that the effect takes to execute. To call this method, you must supply a function that can convert the Duration to the input type of this metric.

  35. final def trackError: ZIOAspect[Nothing, Any, Nothing, In, Nothing, Any]

    Permalink

    Returns a ZIOAspect that will update this metric with the failure value of the effects that it is applied to.

  36. final def trackErrorWith[In2](f: (In2) ⇒ In): ZIOAspect[Nothing, Any, Nothing, In2, Nothing, Any]

    Permalink

    Returns a ZIOAspect that will update this metric with the result of applying the specified function to the error value of the effects that the aspect is applied to.

  37. final def trackSuccess: ZIOAspect[Nothing, Any, Nothing, Any, Nothing, In]

    Permalink

    Returns a ZIOAspect that will update this metric with the success value of the effects that it is applied to.

  38. final def trackSuccessWith[In2](f: (In2) ⇒ In): ZIOAspect[Nothing, Any, Nothing, Any, Nothing, In2]

    Permalink

    Returns a ZIOAspect that will update this metric with the result of applying the specified function to the success value of the effects that the aspect is applied to.

  39. final def update(in: ⇒ In)(implicit trace: Trace): UIO[Unit]

    Permalink

    Updates the metric with the specified update message.

    Updates the metric with the specified update message. For example, if the metric were a counter, the update would increment the method by the provided amount.

  40. final def value(implicit trace: Trace): UIO[Out]

    Permalink

    Retrieves a snapshot of the value of the metric at this moment in time.

  41. final def wait(): Unit

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  43. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. final def withNow[In2](implicit ev: <:<[(In2, Instant), In]): Metric[Type, In2, Out]

    Permalink

Inherited from ZIOAspect[Nothing, Any, Nothing, Any, Nothing, In]

Inherited from AnyRef

Inherited from Any

Ungrouped