2012-11-24 11:33:34 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"code.google.com/p/gorest"
|
2012-11-26 18:56:51 +00:00
|
|
|
"github.com/matttproud/prometheus/storage/metric/leveldb"
|
2012-11-24 11:33:34 +00:00
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2012-11-26 18:56:51 +00:00
|
|
|
m, _ := leveldb.NewLevigoMetricPersistence("/tmp/metrics")
|
2012-11-24 11:33:34 +00:00
|
|
|
s := &MetricsService{
|
|
|
|
persistence: m,
|
|
|
|
}
|
|
|
|
gorest.RegisterService(s)
|
|
|
|
http.Handle("/", gorest.Handle())
|
|
|
|
http.ListenAndServe(":8787", nil)
|
|
|
|
}
|