Class MeteringBehavior

  • All Implemented Interfaces:
    scala.Function1<Object,​scala.runtime.BoxedUnit>, scala.PartialFunction<Object,​scala.runtime.BoxedUnit>

    public class MeteringBehavior
    extends scala.runtime.AbstractPartialFunction<Object,​scala.runtime.BoxedUnit>
    Represents behaviour that can be exhibited by actors of type AbstractActor

    This behaviour meters actor's default behaviour. It captures 2 metrics:

    • message processing rate of actor's receive block
    • message processing rate by message type
    The information is reported to MetricsReporter
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface scala.Function1

        scala.Function1.UnliftOps<A extends Object,​B extends Object>, scala.Function1.UnliftOps$
      • Nested classes/interfaces inherited from interface scala.PartialFunction

        scala.PartialFunction.AndThen<A extends Object,​B extends Object,​C extends Object>, scala.PartialFunction.Combined<A extends Object,​B extends Object,​C extends Object>, scala.PartialFunction.ElementWiseExtractor<A extends Object,​B extends Object>, scala.PartialFunction.ElementWiseExtractor$, scala.PartialFunction.Lifted<A extends Object,​B extends Object>, scala.PartialFunction.OrElse<A extends Object,​B extends Object>, scala.PartialFunction.Unlifted<A extends Object,​B extends Object>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String DOMAIN  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      scala.runtime.BoxedUnit apply​(Object message)
      Uses 2 timers to measure message processing rate.
      boolean isDefinedAt​(Object obj)  
      • Methods inherited from class scala.runtime.AbstractPartialFunction

        andThen, andThen, apply$mcDD$sp, apply$mcDF$sp, apply$mcDI$sp, apply$mcDJ$sp, apply$mcFD$sp, apply$mcFF$sp, apply$mcFI$sp, apply$mcFJ$sp, apply$mcID$sp, apply$mcIF$sp, apply$mcII$sp, apply$mcIJ$sp, apply$mcJD$sp, apply$mcJF$sp, apply$mcJI$sp, apply$mcJJ$sp, apply$mcVD$sp, apply$mcVF$sp, apply$mcVI$sp, apply$mcVJ$sp, apply$mcZD$sp, apply$mcZF$sp, apply$mcZI$sp, apply$mcZJ$sp, applyOrElse, compose, compose, elementWise, lift, orElse, runWith, toString, unapply
    • Constructor Detail

      • MeteringBehavior

        public MeteringBehavior​(AbstractUntypedActorWithMetering actor)
        Constructs an instance.
        Parameters:
        actor - whose behaviour needs to be metered
      • MeteringBehavior

        public MeteringBehavior​(AbstractActor actor)
    • Method Detail

      • isDefinedAt

        public boolean isDefinedAt​(Object obj)
      • apply

        public scala.runtime.BoxedUnit apply​(Object message)
        Uses 2 timers to measure message processing rate. One for overall message processing rate and another to measure rate by message type. The timers are re-used if they were previously created.

        MetricRegistry maintains a reservoir for different timers where collected timings are kept. It exposes various metrics for each timer based on collected data. Eg: count of messages, 99, 95, 50... percentiles, max, mean etc.

        These metrics are exposed as JMX bean.

        Specified by:
        apply in interface scala.Function1<Object,​scala.runtime.BoxedUnit>
        Overrides:
        apply in class scala.runtime.AbstractPartialFunction<Object,​scala.runtime.BoxedUnit>
        Parameters:
        message - the message to process
        See Also:
        http://dropwizard.github.io/metrics/manual/core/#timers