CORAL WIKI

Metrics

It is possible to send metrics to Graphite from Coral actors you create. To do this, use the trait Metrics. You now have metrics object available, which you can use to create a metric and next use it. The library used by Coral is the Metrics-Scala library. See the documentation of this library on how the metrics object works.

See the graphite section of the application.conf for the configuration. By default, logging to Graphite is disabled. At the moment, none of the provided Coral actors use the metrics.

Example

class MyActor extends CoralActor with Metrics with SimpleEmitTrigger {
    val requests = metrics.meter("requests")

    override def simpleEmitTrigger(json: JObject): Option[JValue] = {
        ...
        // Measure the number of requests.
        requests.mark()
        ...
    }
}