technoweenie/grohl — pull request #9 by technoweenie (2013-10-12 17:17:43+00:00)
Title: the Timer object will write to a statter

This lets you setup a statter object in a Timer, so that finishing a timer will write to your stats service.

First, setup a statter for a context:

```go
// uses CurrentStatter, with a sample rate of 1.0 and the specified key
grohl.SetStatter(nil, 1.0, "foo.bar")
timer := grohl.NewTimer(nil)
// some work
timer.Finish()

// you can do this on any context object
context.SetStatter(myStatter, 1.0, "foo.bar")
timer := context.Timer(nil)
// some work
timer.Finish()

// you can also do this just for a timer
timer := context.Timer(nil)
timer.SetStatter(myStatter, 1.0, "foo.bar")
// some work
timer.Finish()
```

/cc @asenchi