Search code examples
scalaplayframeworkanalyticsplayframework-2.0

Playframework embedded lib for statistics timer/counter


In play 1.2.X there is the JAMon API embedded which permits to collect application statistics like counters and timers. You can then store and display this stats using JARep. It is very usefull to analyse trends, and troubleshot performance issues.

  • Is there a similar lib included in play 2.0 ?
  • If not, which lightweight scala-based lib is on a roll ?

Solution

  • There is an implementation of statsd. I don't know this project very well, but it seems answer to your needs :

    This is a simple statsd module for Play! Framework 2.0. It provides a singleton object Statsd with methods for counter and timing calls to statsd.

    Statsd.increment("my.stat")  // Increment my.stat by 1
    Statsd.timing("my.operation", 100)  // my.operation took 100 ms
    Statsd.time("my.operation.i.dont.want.to.time.myself") {
      // do some stuff...
    }
    

    More info on the github page : https://github.com/vznet/play-statsd