README.md: prettifying

This commit is contained in:
Aliaksandr Valialkin 2019-04-08 17:05:34 +03:00
parent 5cc39fde95
commit 8fa7658180

View File

@ -3,7 +3,7 @@
[![Go Report](https://goreportcard.com/badge/github.com/VictoriaMetrics/metrics)](https://goreportcard.com/report/github.com/VictoriaMetrics/metrics) [![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) [![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 ### Features
@ -22,6 +22,8 @@
### Usage ### Usage
```go ```go
import "github.com/VictoriaMetrics/metrics"
// ...
var ( var (
requestsTotal = metrics.NewCounter("requests_total") requestsTotal = metrics.NewCounter("requests_total")
@ -31,10 +33,10 @@ var (
requestDuration = metrics.NewSummary(`requests_duration_seconds{handler="/my/super/handler"}`) requestDuration = metrics.NewSummary(`requests_duration_seconds{handler="/my/super/handler"}`)
) )
// ...
func requestHandler() { func requestHandler() {
startTime := time.Now() startTime := time.Now()
... // ...
requestsTotal.Inc() requestsTotal.Inc()
requestDuration.UpdateDuration(startTime) requestDuration.UpdateDuration(startTime)
} }