diff options
author | Rasmus Dahlberg <rasmus.dahlberg@kau.se> | 2020-11-04 23:09:42 +0100 |
---|---|---|
committer | Rasmus Dahlberg <rasmus.dahlberg@kau.se> | 2020-11-04 23:09:42 +0100 |
commit | 53ad91c63c2788a83d0e80985ffa89ce7cdf203f (patch) | |
tree | 33b7244bc0e7e036ecb411c2d6dfd2d2bc4f6c8c /instance.go | |
parent | 7fb24c41ec04d31d3170c9f26ebdbd6eb2ee5aa5 (diff) |
added prometheus metrics
Diffstat (limited to 'instance.go')
-rw-r--r-- | instance.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/instance.go b/instance.go index 843e9f8..65ebcb3 100644 --- a/instance.go +++ b/instance.go @@ -43,6 +43,10 @@ func (p LogParameters) String() string { return fmt.Sprintf("LogId(%s) TreeId(%d) Prefix(%s) NumAnchors(%d)", base64.StdEncoding.EncodeToString(p.LogId), p.TreeId, p.Prefix, len(p.AnchorList)) } +func (i *LogParameters) id() string { + return base64.StdEncoding.EncodeToString(i.LogId) +} + // NewInstance returns a new STFE Instance func NewInstance(lp *LogParameters, client trillian.TrillianLogClient, deadline time.Duration, mux *http.ServeMux) (*Instance, error) { i := &Instance{ @@ -51,6 +55,7 @@ func NewInstance(lp *LogParameters, client trillian.TrillianLogClient, deadline Deadline: deadline, } i.registerHandlers(mux) + once.Do(metricSetup) return i, nil } |