Enriches the Counter class with new functions.
Enriches the Counter class with new functions.
1.1
Enriches the Gauge class with new functions.
Enriches the Gauge class with new functions.
1.0
Enriches the Histogram class with new functions.
Enriches the Histogram class with new functions.
The unit used to report latency/time measurements is decided by an implicitly available TimeUnit.
If no TimeUnit is in scope it defaults to TimeUnit.SECONDS.
One can either declare an implicit value:
implicit val defaultUnit = TimeUnit.MILLISECONDS
Or as in the this example import an implicit value:
import org.dmonix.prometheus.TimeUnitImplicits.MILLISECONDS val requestLatency:Histogram = ... val result = requestLatency.measure { // Your code here. }
1.0
Combines all the individual metric traits ('*Implicits').
Combines all the individual metric traits ('*Implicits').
Example of usage:
import org.dmonix.prometheus class FooBar extends Implicits
Enriches the Summary class with new functions.
Enriches the Summary class with new functions.
The unit used to report latency/time measurements is decided by an implicitly available TimeUnit.
If no TimeUnit is in scope it defaults to TimeUnit.SECONDS.
One can either declare an implicit value:
implicit val defaultUnit = TimeUnit.MILLISECONDS
Or as in the this example import an implicit value:
import org.dmonix.prometheus.TimeUnitImplicits.MILLISECONDS val requestLatency:Summary = ... val result = requestLatency.measure { // Your code here. }
Holds functions related to 'Counters'
Holds functions related to 'Counters'
1.1
Holds functions related to 'Gauges'
Holds functions related to 'Histograms'
Object with all the metrics traits.
Object with all the metrics traits.
Used for importing the enriched traits as opposed to adding one of the traits to the class.
import org.dmonix.prometheus.Implicits._ val requestLatency:Histogram = ... val result = requestLatency.measure { // Your code here. }
Holds functions related to 'Summaries'
Implicit values one can import for usage with latency metric measurement.
Implicit values one can import for usage with latency metric measurement.
E.g.
import org.dmonix.prometheus.TimeUnitImplicits.MILLISECONDS1.0
Adds a Scala layer on the official [Prometheus Java client](https://github.com/prometheus/client_java) library. The purpose is to elevate on the capabilities of the Scala language and provide more fitting constructs. E.g. lambdas from Java don't translate very well into Scala, so this library provides functional approaches to where the original library uses lambdas. Also for time/latency/gauge measurement purposes this library provides means to measure Futures.
E.g. measuring the time spent in a function block.
Or measuring the time to execute a future provided as result by a function. The code snippet below will measure the time from invoking the function block to when the future is completed