Class InstrumentedEE10Handler

java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.server.Handler.Abstract
org.eclipse.jetty.server.Handler.AbstractContainer
org.eclipse.jetty.server.Handler.Wrapper
io.dropwizard.metrics.jetty12.AbstractInstrumentedHandler
io.dropwizard.metrics.jetty12.ee10.InstrumentedEE10Handler
All Implemented Interfaces:
org.eclipse.jetty.server.Handler, org.eclipse.jetty.server.Handler.Container, org.eclipse.jetty.server.Handler.Singleton, org.eclipse.jetty.server.Request.Handler, org.eclipse.jetty.util.component.Container, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.Dumpable.DumpableContainer, org.eclipse.jetty.util.component.LifeCycle, org.eclipse.jetty.util.thread.Invocable

public class InstrumentedEE10Handler extends io.dropwizard.metrics.jetty12.AbstractInstrumentedHandler
A Jetty Handler which records various metrics about an underlying Handler instance. This Handler requires a ServletContextHandler to be present. For correct behaviour, the ServletContextHandler should be before this handler in the handler chain. To achieve this, one can use ServletContextHandler.insertHandler(Singleton).
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.eclipse.jetty.server.Handler.Abstract

    org.eclipse.jetty.server.Handler.Abstract.NonBlocking

    Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopException

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container

    org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.Listener

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable

    org.eclipse.jetty.util.component.Dumpable.DumpableContainer

    Nested classes/interfaces inherited from interface org.eclipse.jetty.server.Handler

    org.eclipse.jetty.server.Handler.Abstract, org.eclipse.jetty.server.Handler.AbstractContainer, org.eclipse.jetty.server.Handler.Collection, org.eclipse.jetty.server.Handler.Container, org.eclipse.jetty.server.Handler.Sequence, org.eclipse.jetty.server.Handler.Singleton, org.eclipse.jetty.server.Handler.Wrapper

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.Invocable

    org.eclipse.jetty.util.thread.Invocable.Callable, org.eclipse.jetty.util.thread.Invocable.InvocationType, org.eclipse.jetty.util.thread.Invocable.ReadyTask, org.eclipse.jetty.util.thread.Invocable.Task

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

    org.eclipse.jetty.util.component.LifeCycle.Listener

    Nested classes/interfaces inherited from interface org.eclipse.jetty.server.Request.Handler

    org.eclipse.jetty.server.Request.Handler.AbortException
  • Field Summary

    Fields inherited from class io.dropwizard.metrics.jetty12.AbstractInstrumentedHandler

    activeDispatches, activeRequests, activeSuspended, asyncDispatches, asyncTimeouts, COARSE_METER_LEVELS, connectRequests, deleteRequests, DETAILED_METER_LEVELS, dispatches, getRequests, headRequests, metricRegistry, moveRequests, NAME_1XX_RESPONSES, NAME_2XX_RESPONSES, NAME_3XX_RESPONSES, NAME_4XX_RESPONSES, NAME_5XX_RESPONSES, NAME_ACTIVE_DISPATCHES, NAME_ACTIVE_REQUESTS, NAME_ACTIVE_SUSPENDED, NAME_ASYNC_DISPATCHES, NAME_ASYNC_TIMEOUTS, NAME_CONNECT_REQUESTS, NAME_DELETE_REQUESTS, NAME_DISPATCHES, NAME_GET_REQUESTS, NAME_HEAD_REQUESTS, NAME_MOVE_REQUESTS, NAME_OPTIONS_REQUESTS, NAME_OTHER_REQUESTS, NAME_PERCENT_4XX_15M, NAME_PERCENT_4XX_1M, NAME_PERCENT_4XX_5M, NAME_PERCENT_5XX_15M, NAME_PERCENT_5XX_1M, NAME_PERCENT_5XX_5M, NAME_POST_REQUESTS, NAME_PUT_REQUESTS, NAME_REQUESTS, NAME_TRACE_REQUESTS, optionsRequests, otherRequests, postRequests, prefix, putRequests, requests, responseCodeMeters, responseMeteredLevel, responses, traceRequests

    Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    FAILED, STARTED, STARTING, STOPPED, STOPPING

    Fields inherited from interface org.eclipse.jetty.util.component.Dumpable

    KEY

    Fields inherited from interface org.eclipse.jetty.util.thread.Invocable

    __nonBlocking, NOOP
  • Constructor Summary

    Constructors
    Constructor
    Description
    InstrumentedEE10Handler(com.codahale.metrics.MetricRegistry registry)
    Create a new instrumented handler using a given metrics registry.
    InstrumentedEE10Handler(com.codahale.metrics.MetricRegistry registry, String prefix)
    Create a new instrumented handler using a given metrics registry.
    InstrumentedEE10Handler(com.codahale.metrics.MetricRegistry registry, String prefix, com.codahale.metrics.annotation.ResponseMeteredLevel responseMeteredLevel)
    Create a new instrumented handler using a given metrics registry.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    protected void
     
    protected boolean
    isSuspended(org.eclipse.jetty.server.Request request, org.eclipse.jetty.server.Response response)
     
    protected void
    setupServletListeners(org.eclipse.jetty.server.Request request, org.eclipse.jetty.server.Response response)
     

    Methods inherited from class io.dropwizard.metrics.jetty12.AbstractInstrumentedHandler

    getAsyncDispatches, getAsyncTimeouts, getMetricPrefix, getName, getResponseCodeMeter, handle, mark, requestTimer, setName, updateResponses

    Methods inherited from class org.eclipse.jetty.server.Handler.Wrapper

    getHandler, getInvocationType, setHandler

    Methods inherited from class org.eclipse.jetty.server.Handler.AbstractContainer

    findContainerOf, getDescendant, getDescendants, isDynamic, setDynamic, setServer

    Methods inherited from class org.eclipse.jetty.server.Handler.Abstract

    destroy, getServer

    Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle

    addBean, addBean, addEventListener, addManaged, contains, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, installBean, installBean, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeans

    Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.eclipse.jetty.util.component.Container

    getCachedBeans, getEventListeners

    Methods inherited from interface org.eclipse.jetty.util.component.Destroyable

    destroy

    Methods inherited from interface org.eclipse.jetty.util.component.Dumpable

    dumpSelf

    Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer

    isDumpable

    Methods inherited from interface org.eclipse.jetty.server.Handler

    getServer, setServer

    Methods inherited from interface org.eclipse.jetty.server.Handler.Container

    getContainer, getDescendant, getDescendants, getDescendants

    Methods inherited from interface org.eclipse.jetty.server.Handler.Singleton

    getHandlers, getTail, insertHandler, setHandler

    Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle

    addEventListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, start, stop
  • Constructor Details

    • InstrumentedEE10Handler

      public InstrumentedEE10Handler(com.codahale.metrics.MetricRegistry registry)
      Create a new instrumented handler using a given metrics registry.
      Parameters:
      registry - the registry for the metrics
    • InstrumentedEE10Handler

      public InstrumentedEE10Handler(com.codahale.metrics.MetricRegistry registry, String prefix)
      Create a new instrumented handler using a given metrics registry.
      Parameters:
      registry - the registry for the metrics
      prefix - the prefix to use for the metrics names
    • InstrumentedEE10Handler

      public InstrumentedEE10Handler(com.codahale.metrics.MetricRegistry registry, String prefix, com.codahale.metrics.annotation.ResponseMeteredLevel responseMeteredLevel)
      Create a new instrumented handler using a given metrics registry.
      Parameters:
      registry - the registry for the metrics
      prefix - the prefix to use for the metrics names
      responseMeteredLevel - the level to determine individual/aggregate response codes that are instrumented
  • Method Details

    • doStart

      protected void doStart() throws Exception
      Overrides:
      doStart in class io.dropwizard.metrics.jetty12.AbstractInstrumentedHandler
      Throws:
      Exception
    • doStop

      protected void doStop() throws Exception
      Overrides:
      doStop in class io.dropwizard.metrics.jetty12.AbstractInstrumentedHandler
      Throws:
      Exception
    • setupServletListeners

      protected void setupServletListeners(org.eclipse.jetty.server.Request request, org.eclipse.jetty.server.Response response)
      Specified by:
      setupServletListeners in class io.dropwizard.metrics.jetty12.AbstractInstrumentedHandler
    • isSuspended

      protected boolean isSuspended(org.eclipse.jetty.server.Request request, org.eclipse.jetty.server.Response response)
      Specified by:
      isSuspended in class io.dropwizard.metrics.jetty12.AbstractInstrumentedHandler