package dropwizard
- Source
- metrics.scala
- Alphabetic
- By Inheritance
- dropwizard
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
def
metricRegistryEncoder[F[_]](mapper: ObjectMapper = defaultMapper): EntityEncoder[F, MetricRegistry]
Encodes a metric registry in JSON format
-
def
metricsResponse[F[_]](registry: MetricRegistry, mapper: ObjectMapper = defaultMapper)(implicit arg0: Applicative[F]): F[Response[F]]
Returns an OK response with a JSON dump of a MetricRegistry
-
def
metricsService[F[_]](registry: MetricRegistry, mapper: ObjectMapper = defaultMapper)(implicit arg0: Sync[F]): HttpRoutes[F]
Returns an OK response with a JSON dump of a MetricRegistry
-
object
Dropwizard
MetricsOps algebra capable of recording Dropwizard metrics
MetricsOps algebra capable of recording Dropwizard metrics
For example, the following code would wrap a org.http4s.HttpRoutes with a org.http4s.server.middleware.Metrics that records metrics to a given metric registry.
import org.http4s.client.middleware.Metrics import org.http4s.client.dropwizard.Dropwizard val meteredRoutes = Metrics[IO](Dropwizard(registry, "server"))(testRoutes)
Analogously, the following code would wrap a org.http4s.client.Client with a org.http4s.client.middleware.Metrics that records metrics to a given Metric Registry, classifying the metrics by HTTP method.
import org.http4s.client.metrics.core.Metrics import org.http4s.client.metrics.dropwizard.Dropwizard val classifierFunc = (r: Request[IO]) => Some(r.method.toString.toLowerCase) val meteredClient = Metrics(Dropwizard(registry, "client"), classifierFunc)(client)
Registers the following metrics:
{prefix}.{classifier}.active.requests - Counter {prefix}.{classifier}.requests.headers - Timer {prefix}.{classifier}.requests.total - Timer {prefix}.{classifier}.get-requests - Timer {prefix}.{classifier}.post-requests - Timer {prefix}.{classifier}.put-requests - Timer {prefix}.{classifier}.head-requests - Timer {prefix}.{classifier}.move-requests - Timer {prefix}.{classifier}.options-requests - Timer {prefix}.{classifier}.trace-requests - Timer {prefix}.{classifier}.connect-requests - Timer {prefix}.{classifier}.delete-requests - Timer {prefix}.{classifier}.other-requests - Timer {prefix}.{classifier}.1xx-responses - Timer {prefix}.{classifier}.2xx-responses - Timer {prefix}.{classifier}.3xx-responses - Timer {prefix}.{classifier}.4xx-responses - Timer {prefix}.{classifier}.5xx-responses - Timer {prefix}.{classifier}.errors - Timer {prefix}.{classifier}.timeouts - Timer {prefix}.{classifier}.abnormal-terminations - Timer