Class

nl.grons.metrics4.scala

Meter

Related Doc: package scala

Permalink

class Meter extends AnyRef

A Scala facade class for DropwizardMeter.

Example usage:

class Example(val db: Db) extends Instrumented {
  private[this] val rowsLoadedMeter = metrics.meter("rowsLoaded")

  def load(id: Long): Seq[Row] = {
    val rows = db.load(id)
    rowsLoaded.mark(rows.size)
    rows
  }
}
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Meter
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Meter(metric: com.codahale.metrics.Meter)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @throws( ... )
  6. def count: Long

    Permalink

    The number of events which have been marked.

  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. object exceptionMarker

    Permalink

    Gives a marker that runs f, marks the meter on an exception, and returns result of f.

    Gives a marker that runs f, marks the meter on an exception, and returns result of f.

    Example usage:

    class Example(val db: Db) extends Instrumented {
      private[this] val loadExceptionMeter = metrics.meter("load").exceptionMarker
    
      def load(id: Long) = loadExceptionMeter {
        db.load(id)
      }
    }
  10. object exceptionMarkerPF

    Permalink

    Converts partial function pf into a side-effecting partial function that meters thrown exceptions for every invocation of pf (for the cases it is defined).

    Converts partial function pf into a side-effecting partial function that meters thrown exceptions for every invocation of pf (for the cases it is defined). The result is passed unchanged.

    Example usage:

    class Example extends Instrumented {
      val isEven: PartialFunction[Int, String] = {
        case x if x % 2 == 0 => x+" is even"
        case 5 => throw new IllegalArgumentException("5 is unlucky")
      }
    
      val isEvenExceptionMeter = metrics.meter("isEvenExceptions")
      val meteredIsEven: PartialFunction[Int, String] = isEvenExceptionMeter.exceptionMarkerPF(isEven)
    
      val sample = 1 to 10
      sample collect meteredIsEven   // the meter counts 1 exception
    }
  11. def fifteenMinuteRate: Double

    Permalink

    The fifteen-minute exponentially-weighted moving average rate at which events have occurred since the meter was created.

    The fifteen-minute exponentially-weighted moving average rate at which events have occurred since the meter was created.

    This rate has the same exponential decay factor as the fifteen-minute load average in the top Unix command.

  12. def fiveMinuteRate: Double

    Permalink

    The five-minute exponentially-weighted moving average rate at which events have occurred since the meter was created.

    The five-minute exponentially-weighted moving average rate at which events have occurred since the meter was created.

    This rate has the same exponential decay factor as the five-minute load average in the top Unix command.

  13. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  14. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  15. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  16. def mark(count: Long): Unit

    Permalink

    Marks the occurrence of a given number of events.

  17. def mark(): Unit

    Permalink

    Marks the occurrence of an event.

  18. def meanRate: Double

    Permalink

    The mean rate at which events have occurred since the meter was created.

  19. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  21. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  22. def oneMinuteRate: Double

    Permalink

    The one-minute exponentially-weighted moving average rate at which events have occurred since the meter was created.

    The one-minute exponentially-weighted moving average rate at which events have occurred since the meter was created.

    This rate has the same exponential decay factor as the one-minute load average in the top Unix command.

  23. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  24. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  25. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from AnyRef

Inherited from Any

Ungrouped