Skip to content

Commit 6fe063a

Browse files
committed
Add badges and install info
1 parent 807ff48 commit 6fe063a

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Metrics Library for Go
22

3+
[![Travis](https://img.shields.io/travis/istreamlabs/go-metrics.svg)](https://travis-ci.org/istreamlabs/go-metrics) [![Codecov](https://img.shields.io/codecov/c/github/istreamlabs/go-metrics.svg)](https://codecov.io/gh/istreamlabs/go-metrics) [![GitHub tag](https://img.shields.io/github/tag/istreamlabs/go-metrics.svg)](https://github.com/istreamlabs/go-metrics/releases) [![License](https://img.shields.io/github/license/istreamlabs/go-metrics.svg)](https://github.com/istreamlabs/go-metrics/blob/master/LICENSE)
4+
35
A library that provides an interface for sending metrics from your script, application, or service. Metrics consist of a name, value, and optionally some tags that are made up of key/value pairs.
46

57
Multiple implementations are provided to allow for production, local development, and testing use cases. The following clients are available:
@@ -13,7 +15,17 @@ Client | Description
1315

1416
## Example Usage
1517

16-
Generally you will instantiate one of the above clients and then write metrics to it:
18+
Generally you will instantiate one of the above clients and then write metrics to it. First, install the library:
19+
20+
```sh
21+
# If using dep, glide, godep, etc then use that tool. For example:
22+
dep ensure github.com/istreamlabs/go-metrics
23+
24+
# Otherwise, just go get it:
25+
go get github.com/istreamlabs/go-metrics
26+
```
27+
28+
Then you can use it:
1729

1830
```go
1931
import "github.com/istreamlabs/go-metrics"
@@ -29,7 +41,7 @@ client.WithTags(map[string]string{
2941
}).Incr("requests.count")
3042
```
3143

32-
The above code would result in `myprefix.requests.count` with a value of `1` showing up in DataDog. See the [`Client`](https://godoc.org/github.com/istreamlabs/go-metrics/#Client) interface for a list of available metrics methods.
44+
The above code would result in `myprefix.requests.count` with a value of `1` showing up in DataDog if you have [`dogstatsd`](https://docs.datadoghq.com/guides/dogstatsd/) running locally. See the [`Client`](https://godoc.org/github.com/istreamlabs/go-metrics/#Client) interface for a list of available metrics methods.
3345

3446
Also provided are useful clients for testing. For example, the following asserts that a metric with the given name, value, and tag was emitted during a test:
3547

0 commit comments

Comments
 (0)