Meter
A Scala facade class for DropwizardMeter.
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
}
}
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
Type members
Classlikes
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)
}
}
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
exceptionMarker.type
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.
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
}
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
exceptionMarkerPF.type
Value members
Concrete methods
The number of events which have been marked.
The number of events which have been marked.
Attributes
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.
Attributes
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.
Attributes
Marks the occurrence of an event.
Marks the occurrence of an event.
Attributes
Marks the occurrence of a given number of events.
Marks the occurrence of a given number of events.
Attributes
The mean rate at which events have occurred since the meter was created.
The mean rate at which events have occurred since the meter was created.
Attributes
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.