From 8fa7658180f790f36790d32164f3164985ec4bdd Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Mon, 8 Apr 2019 17:05:34 +0300 Subject: [PATCH] README.md: prettifying --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3eeead3..6e7e492 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Go Report](https://goreportcard.com/badge/github.com/VictoriaMetrics/metrics)](https://goreportcard.com/report/github.com/VictoriaMetrics/metrics) [![codecov](https://codecov.io/gh/VictoriaMetrics/metrics/branch/master/graph/badge.svg)](https://codecov.io/gh/VictoriaMetrics/metrics) -# metrics - lightweight alternative to `github.com/prometheus/client_golang/prometheus`. +# metrics - lightweight package for exporting metrics in Prometheus format ### Features @@ -22,6 +22,8 @@ ### Usage ```go +import "github.com/VictoriaMetrics/metrics" +// ... var ( requestsTotal = metrics.NewCounter("requests_total") @@ -31,10 +33,10 @@ var ( requestDuration = metrics.NewSummary(`requests_duration_seconds{handler="/my/super/handler"}`) ) - +// ... func requestHandler() { startTime := time.Now() - ... + // ... requestsTotal.Inc() requestDuration.UpdateDuration(startTime) }