Packages

object Dropwizard

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

Source
Dropwizard.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Dropwizard
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def apply[F[_]](registry: MetricRegistry, prefix: String = "org.http4s.server")(implicit F: Sync[F]): MetricsOps[F]

    Creates a MetricsOps that supports Dropwizard metrics

    Creates a MetricsOps that supports Dropwizard metrics

    registry

    a dropwizard metric registry

    prefix

    a prefix that will be added to all metrics

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  17. def toString(): String
    Definition Classes
    AnyRef → Any
  18. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped