README.md: fixed NewGauge usage
This commit is contained in:
parent
d3611a2799
commit
a62b8e250a
11
README.md
11
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()
|
||||
|
Loading…
Reference in New Issue
Block a user