The number of events which have been marked.
Gives a marker that runs f, marks the meter on an exception, and returns result of f.
Gives a marker that runs f, marks the meter on an exception, and returns result of f.
Example usage:
class Example(val db: Db) extends Instrumented {
private[this] val loadExceptionMeter = metrics.meter("load").exceptionMarker
def load(id: Long) = loadExceptionMeter {
db.load(id)
}
}
Converts partial function pf into a side-effecting partial function that meters
thrown exceptions for every invocation of pf (for the cases it is defined).
Converts partial function pf into a side-effecting partial function that meters
thrown exceptions for every invocation of pf (for the cases it is defined).
The result is passed unchanged.
Example usage:
class Example extends Instrumented {
val isEven: PartialFunction[Int, String] = {
case x if x % 2 == 0 => x+" is even"
case 5 => throw new IllegalArgumentException("5 is unlucky")
}
val isEvenExceptionMeter = metrics.meter("isEvenExceptions")
val meteredIsEven: PartialFunction[Int, String] = isEvenExceptionMeter.exceptionMarkerPF(isEven)
val sample = 1 to 10
sample collect meteredIsEven // the meter counts 1 exception
}
The fifteen-minute exponentially-weighted moving average rate at which events have occurred since the meter was created.
The fifteen-minute exponentially-weighted moving average rate at which events have occurred since the meter was created.
This rate has the same exponential decay factor as the fifteen-minute load average in the top Unix command.
The five-minute exponentially-weighted moving average rate at which events have occurred since the meter was created.
The five-minute exponentially-weighted moving average rate at which events have occurred since the meter was created.
This rate has the same exponential decay factor as the five-minute load average in the top Unix command.
Marks the occurrence of a given number of events.
Marks the occurrence of an event.
The mean rate at which events have occurred since the meter was created.
The one-minute exponentially-weighted moving average rate at which events have occurred since the meter was created.
The one-minute exponentially-weighted moving average rate at which events have occurred since the meter was created.
This rate has the same exponential decay factor as the one-minute load average in the top Unix command.
A Scala façade class for Meter.
Example usage:
class Example(val db: Db) extends Instrumented { private[this] val rowsLoadedMeter = metrics.meter("rowsLoaded") def load(id: Long): Seq[Row] = { val rows = db.load(id) rowsLoaded.mark(rows.size) rows } }