Permalink
Browse files

fixing some config problems

  • Loading branch information...
1 parent 82cd96d commit 3f27abd06695b5aecc708f1dff79c60478284907 @dyross dyross committed Jan 12, 2012
@@ -2,14 +2,16 @@
import play.jobs.Every
import play.modules.statsd.Statsd
import play.jobs.Job
+import play.Logger
@Every("1s")
class SomeJob extends Job {
override def doJob() {
+ Logger.info("doing job...")
Statsd.increment("test1", 50)
Statsd.timing("test2", 1000)
Statsd.time("test3") {
// do work
}
}
-}
+}
@@ -5,7 +5,7 @@ application.name=sample-statsd
# this will be changed once it's in the repo
module.statsd=../../
-#statsd.enabled=true
-#statsd.host=localhost
+statsd.enabled=true
+#statsd.host=graphite.klout
#statsd.port=8125
-#statsd.stat.prefix=statsd-sample
+#statsd.stat.prefix=statsd-sample
@@ -47,13 +47,19 @@ private[statsd] trait RealStatsdClientCake extends StatsdClientCake {
private val HostnameProperty = "statsd.host"
// The property name for the application stat prefix.
- private val StatPrefixProperty = "statsd.prefix"
+ private val StatPrefixProperty = "statsd.stat.prefix"
// Use scala's Random util for nextFloat.
private lazy val random = new Random
// The stat prefix used by the client.
- override val statPrefix = play.configuration(StatPrefixProperty, "statsd")
+ override val statPrefix = {
+ val default = "statsd"
+ val configured = play.configuration(StatPrefixProperty, default)
+ if (configured == default)
+ Logger.warn("using default prefix: " + default)
+ configured
+ }
/**
* Use {@code System.currentTimeMillis()} to get the current time.

0 comments on commit 3f27abd

Please sign in to comment.