Class

nl.grons.metrics.scala

Timer

Related Doc: package scala

Permalink

class Timer extends AnyRef

A Scala facade class for DropwizardTimer.

Example usage:

class Example(val db: Db) extends Instrumented {
  private[this] val loadTimer = metrics.timer("load")

  def load(id: Long) = loadTimer.time {
    db.load(id)
  }
}
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Timer
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

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

    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
    @throws( ... )
  6. def count: Long

    Permalink

    The number of durations recorded.

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  9. def fifteenMinuteRate: Double

    Permalink

    The fifteen-minute rate of timings.

  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. def fiveMinuteRate: Double

    Permalink

    The five-minute rate of timings.

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

    Permalink
    Definition Classes
    AnyRef → Any
  13. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  14. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  15. def max: Long

    Permalink

    The longest recorded duration in nanoseconds.

  16. def mean: Double

    Permalink

    The arithmetic mean of all recorded durations in nanoseconds.

  17. def meanRate: Double

    Permalink

    The mean rate of timings.

  18. def min: Long

    Permalink

    The shortest recorded duration in nanoseconds.

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

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

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

    Permalink
    Definition Classes
    AnyRef
  22. def oneMinuteRate: Double

    Permalink

    The one-minute rate of timings.

  23. def snapshot: Snapshot

    Permalink

    A snapshot of the values in the timer's sample.

  24. def stdDev: Double

    Permalink

    The standard deviation of all recorded durations.

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

    Permalink
    Definition Classes
    AnyRef
  26. def time[A](f: ⇒ A): A

    Permalink

    Runs f, recording its duration, and returns its result.

  27. def timePF[A, B](pf: PartialFunction[A, B]): PartialFunction[A, B]

    Permalink

    Converts partial function pf into a side-effecting partial function that times every invocation of pf for which it is defined.

    Converts partial function pf into a side-effecting partial function that times every invocation of pf for which 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"
      }
    
      val isEvenTimer = metrics.timer("isEven")
      val timedIsEven: PartialFunction[Int, String] = isEvenTimer.timePF(isEven)
    
      val sample = 1 to 10
      sample collect timedIsEven   // timer does 5 measurements
    }
  28. def timerContext(): Context

    Permalink

    A timing com.codahale.metrics.Timer.Context, which measures an elapsed time in nanoseconds.

  29. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  30. def update(duration: Long, unit: TimeUnit): Unit

    Permalink

    Adds a recorded duration.

  31. def update(duration: FiniteDuration): Unit

    Permalink

    Adds a recorded duration.

  32. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long, arg1: Int): Unit

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped