Skip to content

Instantly share code, notes, and snippets.

@andybons
Created October 10, 2012 23:48
Show Gist options
  • Save andybons/3869270 to your computer and use it in GitHub Desktop.
Save andybons/3869270 to your computer and use it in GitHub Desktop.
package metrics
import (
"github.com/stathat/go"
"time"
)
func Count(name string) {
stathat.PostEZCountOne(name, "YOUR_EZKEY")
}
func Timed(name string, f func()) {
now := time.Now()
f()
stathat.PostEZValue(name, "YOUR_EZKEY", time.Since(now).Seconds())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment