From a62b8e250a0d9e403f7f9ed7d011cee624f3ab0c Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Mon, 8 Apr 2019 21:11:48 +0300 Subject: [PATCH] README.md: fixed NewGauge usage --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 277ae78..0575919 100644 --- a/README.md +++ b/README.md @@ -25,12 +25,15 @@ import "github.com/VictoriaMetrics/metrics" var ( requestsTotal = metrics.NewCounter("requests_total") - queueSize = metrics.NewGauge(`queue_size{queue="foobar"}`, func() float64 { - return float64(foobarQueue.Len()) - }) - requestDuration = metrics.NewSummary(`requests_duration_seconds{handler="/my/super/handler"}`) ) + +func init() { + metrics.NewGauge(`queue_size{queue="foobar",topic="baz"}`, func() float64 { + return float64(foobarQueue.Len()) + }) +} + // ... func requestHandler() { startTime := time.Now()