Trait

au.com.agiledigital.kamon.play_extensions

Metrics

Related Doc: package play_extensions

Permalink

trait Metrics extends AnyRef

Injectable wrapper around the Kamon Tracer singleton. Provides additional methods to automatically name traces and to maintain a completion count of futures that succeed / fail.

Supports creating new instances that categorise contexts created within them. Enables nesting traces metrics. Should be used in conjunction with the EscapingMetricKeyGenerator if metric names are to be nested in statsd.

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Metrics
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def clearCurrentContext(): Unit

    Permalink

    Clears the current TraceContext.

  2. abstract def currentContext: TraceContext

    Permalink

    Returns the current TraceContext.

    Returns the current TraceContext. May return an empty trace context if not trace context is currently active.

    returns

    the current trace context.

  3. abstract def setCurrentContext(context: TraceContext): Unit

    Permalink

    Sets the current TraceContext.

    Sets the current TraceContext.

    context

    the context that should be set as the current trace context.

  4. abstract def withCategory(category: String): Metrics

    Permalink

    Creates a new Metrics with the specified category.

    Creates a new Metrics with the specified category. Chaining calls to this method will produce nested categories.

    category

    the name of the category (or sub-category).

    returns

    the new Metrics.

  5. abstract def withNewAsyncContext[T](traceName: String, autoFinish: Boolean, count: Boolean)(code: ⇒ Future[T])(implicit executionContext: ExecutionContext): Future[T]

    Permalink

    Creates a new context wrapping code that produces a Future.

    Creates a new context wrapping code that produces a Future. If autoFinish is set to true, will finish the context when the future completes.

    T

    the type produced by the Future.

    traceName

    the name of the trace to be started.

    autoFinish

    whether the trace should be finished when the future completes.

    count

    whether to count the number of futures that complete with success / failure.

    code

    the code that will be executed within the context.

    executionContext

    used to handle the onComplete callback.

    returns

    the Future produced by the code.

  6. abstract def withNewContext[T](traceName: String, traceToken: Option[String], autoFinish: Boolean)(code: ⇒ T): T

    Permalink

    Creates a new trace context that wrap the supplied code and sets it as the current context.

    Creates a new trace context that wrap the supplied code and sets it as the current context.

    T

    the type of the result produced by the code.

    traceName

    the name of the trace.

    traceToken

    the trace token.

    autoFinish

    whether the trace should be finished when the code has been executed.

    code

    the code to be executed within the context.

    returns

    the result produced by the code.

Concrete 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. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

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

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

    Permalink
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  15. final def synchronized[T0](arg0: ⇒ T0): T0

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

    Permalink
    Definition Classes
    AnyRef → Any
  17. def traced[T](code: ⇒ T)(implicit name: Name): T

    Permalink

    Creates a new context wrapping the specified code named using the implicitly passed name.

    Creates a new context wrapping the specified code named using the implicitly passed name.

    Auto-finishes.

    T

    the type produced by the code block.

    code

    the code that will be executed within the context.

    name

    the implicitly supplied name of the caller.

    returns

    the result produced by the code.

  18. def tracedAsync[T](code: ⇒ Future[T])(implicit name: Name, executionContext: ExecutionContext): Future[T]

    Permalink

    Creates a new context wrapping the specified Future producing code named using the implicitly passed name.

    Creates a new context wrapping the specified Future producing code named using the implicitly passed name.

    Auto-finishes and counts.

    T

    the type produced by the Future.

    code

    the code that will be executed within the context.

    name

    the implicitly supplied name of the caller.

    executionContext

    used to handle the onComplete callback.

    returns

    the Future produced by the code.

  19. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. def withNewContext[T](traceName: String, autoFinish: Boolean)(code: ⇒ T): T

    Permalink

    Creates a new trace context that wrap the supplied code and sets it as the current context.

    Creates a new trace context that wrap the supplied code and sets it as the current context.

    T

    the type of the result produced by the code.

    traceName

    the name of the trace.

    autoFinish

    whether the trace should be finished when the code has been executed.

    code

    the code to be executed within the context.

    returns

    the result produced by the code.

  23. def withNewContext[T](traceName: String, traceToken: Option[String])(code: ⇒ T): T

    Permalink

    Creates a new trace context that wrap the supplied code and sets it as the current context.

    Creates a new trace context that wrap the supplied code and sets it as the current context.

    Does not autoFinish.

    T

    the type of the result produced by the code.

    traceName

    the name of the trace.

    traceToken

    the trace token.

    code

    the code to be executed within the context.

    returns

    the result produced by the code.

  24. def withNewContext[T](traceName: String)(code: ⇒ T): T

    Permalink

    Creates a new trace context that wrap the supplied code and sets it as the current context.

    Creates a new trace context that wrap the supplied code and sets it as the current context.

    Does not autoFinish.

    T

    the type of the result produced by the code.

    traceName

    the name of the trace.

    code

    the code to be executed within the context.

    returns

    the result produced by the code.

Inherited from AnyRef

Inherited from Any

Ungrouped