com.netaporter.salad.metrics.spray.metrics

CounterMetricByUri

case class CounterMetricByUri(metricsEventActor: ActorRef, handleFailures: CountIncrementer = CounterMetric.nilIncrementer, handleRejections: CountIncrementer = CounterMetric.nilIncrementer, handleExceptions: CountIncrementer = CounterMetric.nilIncrementer, handleSuccesses: CountIncrementer = CounterMetric.incSuccesses) extends CounterBase with Product with Serializable

Provides a builder that can provide a new spray.routing.Directive, which will count successful, failed, rejected or excepted operations in a given spray.routing.Route.

The actual identifiers for this counter will be, depending on the incoming URL (e.g. /path/to/route translates to path.to.route):

- {path.to.route}.successes - {path.to.route}.failures - {path.to.route}.rejections - {path.to.route}.exceptions

metricsEventActor

The instance of the MetricRegistry that holds the counter metric.

handleFailures

A function that will increment {prefix}.failures. Defaults to com.netaporter.salad.metrics.spray.metrics.CounterMetric.CountIncrementer#nilIncrementer.

handleRejections

A function that will increment {prefix}.rejections. Defaults to com.netaporter.salad.metrics.spray.metrics.CounterMetric.CountIncrementer#nilIncrementer.

handleExceptions

A function that will increment {prefix}.exceptions. Defaults to com.netaporter.salad.metrics.spray.metrics.CounterMetric.CountIncrementer#nilIncrementer.

handleSuccesses

A function that will increment {prefix}.successes. Defaults to com.netaporter.salad.metrics.spray.metrics.CounterMetric.CountIncrementer#incSuccesses.

Linear Supertypes
Serializable, Serializable, Product, Equals, CounterBase, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. CounterMetricByUri
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. CounterBase
  7. AnyRef
  8. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new CounterMetricByUri(metricsEventActor: ActorRef, handleFailures: CountIncrementer = CounterMetric.nilIncrementer, handleRejections: CountIncrementer = CounterMetric.nilIncrementer, handleExceptions: CountIncrementer = CounterMetric.nilIncrementer, handleSuccesses: CountIncrementer = CounterMetric.incSuccesses)

    Create the counter metric that will use the route path for the metric name.

    Create the counter metric that will use the route path for the metric name.

    metricsEventActor

    The instance of the MetricRegistry that holds the counter metric.

    handleFailures

    A function that will increment {prefix}.failures. Defaults to com.netaporter.salad.metrics.spray.metrics.CounterMetric.CountIncrementer#nilIncrementer.

    handleRejections

    A function that will increment {prefix}.rejections. Defaults to com.netaporter.salad.metrics.spray.metrics.CounterMetric.CountIncrementer#nilIncrementer.

    handleExceptions

    A function that will increment {prefix}.exceptions. Defaults to com.netaporter.salad.metrics.spray.metrics.CounterMetric.CountIncrementer#nilIncrementer.

    handleSuccesses

    A function that will increment {prefix}.successes. Defaults to com.netaporter.salad.metrics.spray.metrics.CounterMetric.CountIncrementer#incSuccesses.

Value Members

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

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

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

    Definition Classes
    AnyRef → Any
  4. def all: CounterMetricByUri

    Returns a new instance of the CounterMetric that will count successes, failures, rejections and exceptions.

  5. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  6. def buildAfter(key: String): (Any) ⇒ Any

    The spray.routing.directives.BasicDirectives#around directive requires that the caller return a function that will process what happens after the specific spray.routing.Route completes.

    The spray.routing.directives.BasicDirectives#around directive requires that the caller return a function that will process what happens after the specific spray.routing.Route completes. This method builds that function.

    key

    The prefix that we can send to any of the incrementation handlers.

    returns

    The function that can deal with the result of the spray.routing.Route's evaluation.

    Definition Classes
    CounterBase
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. val count: Directive0

    This is the instance of the spray.routing.Directive that you can use in your spray.routing.Route.

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

    Definition Classes
    AnyRef
  10. def exceptions: CounterMetricByUri

    Returns a new instance of the CounterMetric that will count exceptions.

    Returns a new instance of the CounterMetric that will count exceptions. Any other counting aspect will remain as it was.

  11. def failures: CounterMetricByUri

    Returns a new instance of the CounterMetric that will count rejections.

    Returns a new instance of the CounterMetric that will count rejections. Any other counting aspect will remain as it was.

  12. def finalize(): Unit

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

    Definition Classes
    AnyRef → Any
  14. val handleExceptions: CountIncrementer

    A function that will increment {prefix}.exceptions.

    A function that will increment {prefix}.exceptions. Defaults to com.netaporter.salad.metrics.spray.metrics.CounterMetric.CountIncrementer#nilIncrementer.

    Definition Classes
    CounterMetricByUriCounterBase
  15. val handleFailures: CountIncrementer

    A function that will increment {prefix}.failures.

    A function that will increment {prefix}.failures. Defaults to com.netaporter.salad.metrics.spray.metrics.CounterMetric.CountIncrementer#nilIncrementer.

    Definition Classes
    CounterMetricByUriCounterBase
  16. val handleRejections: CountIncrementer

    A function that will increment {prefix}.rejections.

    A function that will increment {prefix}.rejections. Defaults to com.netaporter.salad.metrics.spray.metrics.CounterMetric.CountIncrementer#nilIncrementer.

    Definition Classes
    CounterMetricByUriCounterBase
  17. val handleSuccesses: CountIncrementer

    A function that will increment {prefix}.successes.

    A function that will increment {prefix}.successes. Defaults to com.netaporter.salad.metrics.spray.metrics.CounterMetric.CountIncrementer#incSuccesses.

    Definition Classes
    CounterMetricByUriCounterBase
  18. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  19. val metricsEventActor: ActorRef

    The instance of the MetricRegistry that holds the counter metric.

    The instance of the MetricRegistry that holds the counter metric.

    Definition Classes
    CounterMetricByUriCounterBase
  20. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  21. def noSuccesses: CounterMetricByUri

    Returns a new instance of the CounterMetric that will not count successes.

    Returns a new instance of the CounterMetric that will not count successes. Any other counting aspect will remain as it was.

  22. final def notify(): Unit

    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  24. def rejections: CounterMetricByUri

    Returns a new instance of the CounterMetric that will count failures.

    Returns a new instance of the CounterMetric that will count failures. Any other counting aspect will remain as it was.

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

    Definition Classes
    AnyRef
  26. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from CounterBase

Inherited from AnyRef

Inherited from Any

Ungrouped