aboutsummaryrefslogtreecommitdiff
path: root/metric.go
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus.dahlberg@kau.se>2020-11-10 19:52:32 +0100
committerRasmus Dahlberg <rasmus.dahlberg@kau.se>2020-11-10 19:52:32 +0100
commit998b68425f2c5e09ac37d864dfc3ead2b7163e09 (patch)
tree931d4009e50752d7eb05154e42cf0459312c65df /metric.go
parentf578f9fa42a45454b0c3c579ea30d79bf948d859 (diff)
replaced sync.Once with init()
Diffstat (limited to 'metric.go')
-rw-r--r--metric.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/metric.go b/metric.go
index 7179458..1d0f100 100644
--- a/metric.go
+++ b/metric.go
@@ -1,14 +1,11 @@
package stfe
import (
- "sync"
-
"github.com/google/trillian/monitoring"
"github.com/google/trillian/monitoring/prometheus"
)
var (
- once sync.Once
reqcnt monitoring.Counter // number of incoming http requests
rspcnt monitoring.Counter // number of valid http responses
latency monitoring.Histogram // request-response latency
@@ -17,7 +14,7 @@ var (
lastSthSize monitoring.Gauge // tree size of most recent sth
)
-func metricSetup() {
+func init() {
mf := prometheus.MetricFactory{}
reqcnt = mf.NewCounter("http_req", "number of http requests", "logid", "endpoint")
rspcnt = mf.NewCounter("http_rsp", "number of http requests", "logid", "endpoint", "status")