Labelled

sealed abstract class Labelled[F[_], -A]

A derived metric type that can time a given operation. See Timer.Labelled.fromHistogram and Timer.Labelled.fromGauge for more information.

Companion:
object
Source:
Timer.scala
class Object
trait Matchable
class Any
Labelled[F, A]

Type members

Types

type Metric

Value members

Abstract methods

def recordTime(duration: FiniteDuration, labels: A): F[Unit]

Concrete methods

def contramapLabels[B](f: B => A): Labelled[F, B]
def mapK[G[_] : Clock](fk: FunctionK[F, G]): Labelled[G, A]
final def time[B](fb: F[B], labels: A): F[B]

Time an operation using an instance of cats.effect.kernel.Clock.

Time an operation using an instance of cats.effect.kernel.Clock.

The resulting metrics depend on the underlying implementation. See Timer.fromHistogram and Timer.fromGauge for more details.

Value parameters:
fb

operation to be timed

labels

labels to add to the underlying metric

Source:
Timer.scala
final def timeAttempt[B](fb: F[B])(labelsSuccess: B => A, labelsError: PartialFunction[Throwable, A]): F[B]

Time an operation using an instance of cats.effect.kernel.Clock, handling failures and computing labels from the result.

Time an operation using an instance of cats.effect.kernel.Clock, handling failures and computing labels from the result.

Value parameters:
fb

operation to be timed

labelsError

partial function to convert an exception raised on unsuccessful operation of fb. If the exception does not match the provided scala.PartialFunction then no value will be recorded.

labelsSuccess

function to convert the successful result of fb to labels

Source:
Timer.scala
final def timeWithComputedLabels[B](fb: F[B])(labels: B => A): F[B]

Time an operation using an instance of cats.effect.kernel.Clock, computing labels from the result.

Time an operation using an instance of cats.effect.kernel.Clock, computing labels from the result.

Value parameters:
fb

operation to be timed

labels

function to convert the result of fb to labels

Source:
Timer.scala