Attributes
- Companion
- object
- Source
- Meter.scala
- Graph
-
- Supertypes
Members list
Value members
Abstract methods
Constructs a batch callback.
Constructs a batch callback.
Batch callbacks allow a single callback to observe measurements for multiple asynchronous instruments.
The callback will be called when the instruments are being observed.
Attributes
- Example
-
val meter: Meter[F] = ??? val server: F[Unit] = ??? // runs the server val background: Resource[F, Unit] = meter.batchCallback.of( meter.observableCounter[Long]("counter").createObserver, meter.observableUpDownCounter[Double]("up-down-counter").createObserver, meter.observableGauge[Double]("gauge").createObserver ) { (counter, upDownCounter, gauge) => counter.record(1L) *> upDownCounter.record(2.0) *> gauge.record(3.0) } background.surround(server) // register batch callback and run the server
- Source
- Meter.scala
Creates a builder of Counter instrument that records values of type A
.
Type parameters
- A
-
the type of the measurement. scala.Long and scala.Double are supported out of the box
Value parameters
- name
-
the name of the instrument
Attributes
- See also
-
See upDownCounter for non-monotonic alternative
- Note
-
the
A
type must be provided explicitly, for examplemeter.counter[Long]
ormeter.counter[Double]
- Example
-
val meter: Meter[F] = ??? val doubleCounter: F[Counter[F, Double]] = meter.counter[Double]("double-counter").create val longCounter: F[Counter[F, Long]] = meter.counter[Long]("long-counter").create
- Source
- Meter.scala
Creates a builder of Histogram instrument that records values of type A
.
Type parameters
- A
-
the type of the measurement. scala.Long and scala.Double are supported out of the box
Value parameters
- name
-
the name of the instrument
Attributes
- Note
-
the
A
type must be provided explicitly, for examplemeter.histogram[Long]
ormeter.histogram[Double]
- Example
-
val meter: Meter[F] = ??? val doubleHistogram: F[Histogram[F, Double]] = meter.histogram[Double]("double-histogram").create val longHistogram: F[Histogram[F, Long]] = meter.histogram[Long]("long-histogram").create
- Source
- Meter.scala
Creates a builder of ObservableCounter instrument that collects values of type A
from the given callback.
Creates a builder of ObservableCounter instrument that collects values of type A
from the given callback.
The ObservableCounter is monotonic. This means the aggregated value is nominally increasing.
Type parameters
- A
-
the type of the measurement. scala.Long and scala.Double are supported out of the box
Value parameters
- name
-
the name of the instrument
Attributes
- See also
-
See observableUpDownCounter for non-monotonic alternative
- Note
-
the
A
type must be provided explicitly, for examplemeter.observableCounter[Long]
ormeter.observableCounter[Double]
- Example
-
val meter: Meter[F] = ??? val doubleObservableCounter: Resource[F, ObservableCounter] = meter .observableCounter[Double]("double-counter") .create(Sync[F].delay(List(Measurement(1.0)))) val longObservableCounter: Resource[F, ObservableCounter] = meter .observableCounter[Long]("long-counter") .create(Sync[F].delay(List(Measurement(1L))))
- Source
- Meter.scala
Creates a builder of ObservableGauge instrument that collects values of type A
from the given callback.
Creates a builder of ObservableGauge instrument that collects values of type A
from the given callback.
Type parameters
- A
-
the type of the measurement. scala.Long and scala.Double are supported out of the box
Value parameters
- name
-
the name of the instrument
Attributes
- Note
-
the
A
type must be provided explicitly, for examplemeter.observableGauge[Long]
ormeter.observableGauge[Double]
- Example
-
val meter: Meter[F] = ??? val doubleGauge: Resource[F, ObservableGauge] = meter .observableGauge[Double]("double-gauge") .create(Sync[F].delay(List(Measurement(1.0)))) val longGauge: Resource[F, ObservableGauge] = meter .observableGauge[Long]("long-gauge") .create(Sync[F].delay(List(Measurement(1L))))
- Source
- Meter.scala
Creates a builder of ObservableUpDownCounter instrument that collects values of type A
from the given callback.
Creates a builder of ObservableUpDownCounter instrument that collects values of type A
from the given callback.
The ObservableUpDownCounter is non-monotonic. This means the aggregated value can increase and decrease.
Type parameters
- A
-
the type of the measurement. scala.Long and scala.Double are supported out of the box
Value parameters
- name
-
the name of the instrument
Attributes
- See also
-
See observableCounter for monotonic alternative
- Note
-
the
A
type must be provided explicitly, for examplemeter.observableUpDownCounter[Long]
ormeter.observableUpDownCounter[Double]
the
A
type must be provided explicitly, for examplemeter.observableCounter[Long]
ormeter.observableCounter[Double]
- Example
-
val meter: Meter[F] = ??? val doubleObservableUpDownCounter: Resource[F, ObservableUpDownCounter] = meter .observableUpDownCounter[Double]("double-up-down-counter") .create(Sync[F].delay(List(Measurement(1.0)))) val longObservableUpDownCounter: Resource[F, ObservableUpDownCounter] = meter .observableUpDownCounter[Long]("long-up-down-counter") .create(Sync[F].delay(List(Measurement(1L))))
- Source
- Meter.scala
Creates a builder of UpDownCounter instrument that records values of type A
.
Creates a builder of UpDownCounter instrument that records values of type A
.
The UpDownCounter is non-monotonic. This means the aggregated value can increase and decrease.
Type parameters
- A
-
the type of the measurement. scala.Long and scala.Double are supported out of the box
Value parameters
- name
-
the name of the instrument
Attributes
- See also
-
See counter for monotonic alternative
- Note
-
the
A
type must be provided explicitly, for examplemeter.upDownCounter[Long]
ormeter.upDownCounter[Double]
- Example
-
val meter: Meter[F] = ??? val doubleUpDownCounter: F[UpDownCounter[F, Double]] = meter.upDownCounter[Double]("double-up-down-counter").create val longUpDownCounter: F[UpDownCounter[F, Long]] = meter.upDownCounter[Long]("long-up-down-counter").create
- Source
- Meter.scala