The CounterBase trait provides helpers for derivations that implement specific types of Counter metrics.
Provides a builder that can provide a new spray.routing.Directive, which
Provides a builder that can provide a new spray.routing.Directive, which will count successful, failed, rejected or excepted operations in a given spray.routing.Route.
Provides a builder that can provide a new spray.routing.Directive, which will count successful, failed, rejected or excepted operations in a given spray.routing.Route.
The actual identifiers for this counter will be, depending on the incoming
URL (e.g. /path/to/route
translates to path.to.route
):
- {path.to.route}.successes - {path.to.route}.failures - {path.to.route}.rejections - {path.to.route}.exceptions
The instance of the MetricRegistry that holds the counter metric.
A function that will increment {prefix}.failures
. Defaults to
com.netaporter.salad.metrics.spray.metrics.CounterMetric.CountIncrementer#nilIncrementer.
A function that will increment {prefix}.rejections
. Defaults to
com.netaporter.salad.metrics.spray.metrics.CounterMetric.CountIncrementer#nilIncrementer.
A function that will increment {prefix}.exceptions
. Defaults to
com.netaporter.salad.metrics.spray.metrics.CounterMetric.CountIncrementer#nilIncrementer.
A function that will increment {prefix}.successes
. Defaults to
com.netaporter.salad.metrics.spray.metrics.CounterMetric.CountIncrementer#incSuccesses.
Provides a Meter metric that will mark a specific event under a Meter of a specific name.
Provides a Meter metric that will mark a specific event under a Meter of a specific name.
The name under which the meter exists.
The instance of the Actor to which a Meter event should be sent
Provides a Meter metric that will mark a specific event under a Meter of a specific name, when the request has completed and is being sent to the user
Provides a Meter metric that will mark a specific event under a Meter of a specific name, when the request has completed and is being sent to the user
The name under which the meter exists.
The instance of the Actor to which a Meter event should be sent
Provides an entry point to creating metric accumulators specific to the Coda Hale Metrics library (http://metrics.codahale.com).
Provides an entry point to creating metric accumulators specific to the Coda Hale Metrics library (http://metrics.codahale.com).
This trait is intended to be used to construct objects that provide spray.routing.Directives, which can then be used to instrument your spray.routing.Routes with metrics accumulators. You would create these instances, and then join them together however you like in order to ease how your code is instrumented.
import com.codahale.metrics.MetricRegistry class MyApp extends Directives { val metricRegistry = new MetricRegistry() val metricFactory = CodaHaleMetricsDirectiveFactory(metricRegistry) // Creates a counter that measures failures only under the name of the // path to the current route val counter = metricFactory.counter.failures.noSuccesses.count // Creates a timer that measures everything under the name of the // path to the current route val timer = metricFactory.timer.time // Joins the two metrics into a single directive val measure = counter | timer val apiRoute = path("something") { measure { get { // do the thing } } } }
The TimerBase trait provides helpers for derivations that implement specific types of Timer metrics.
Provides a Timer metric that will record times on the timer under the name given.
Provides a Timer metric that will record times on the timer under the name given.
The name for this particular timer.
The instance of an ActorRef to whcih we send the elapsed time of a event (nanos)
Provides a Timer metric that will record times on the timer under the name given.
Provides a Timer metric that will record times on the timer under the name given.
The instance of an ActorRef to whcih we send the elapsed time of a event (nanos)
The CounterMetric object holds helpers for code that implements Counters.
Provides helper methods for metrics.
Provides construction for an instance of the CodaHaleMetricsDirectiveFactory.
Provides a builder that can provide a new spray.routing.Directive, which
will count successful, failed, rejected or excepted operations in a given spray.routing.Route
The actual identifiers for this counter will be, given a specific
prefix
:- {prefix}.successes - {prefix}.failures - {prefix}.rejections - {prefix}.exceptions
The user-specific designation for this counter's Id.
The instance of the actor that is recieveing the IncCounter message requests
A function that will increment
{prefix}.failures
. Defaults to com.netaporter.salad.metrics.spray.metrics.CounterMetric.CountIncrementer#nilIncrementer.A function that will increment
{prefix}.rejections
. Defaults to com.netaporter.salad.metrics.spray.metrics.CounterMetric.CountIncrementer#nilIncrementer.A function that will increment
{prefix}.exceptions
. Defaults to com.netaporter.salad.metrics.spray.metrics.CounterMetric.CountIncrementer#nilIncrementer.A function that will increment
{prefix}.successes
. Defaults to com.netaporter.salad.metrics.spray.metrics.CounterMetric.CountIncrementer#incSuccesses.