Skip to content
This repository has been archived by the owner on May 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #25 from essentialkaos/develop
Browse files Browse the repository at this point in the history
Version 7.0.0
  • Loading branch information
andyone authored May 26, 2017
2 parents bba03ad + ea7b86f commit d135fc7
Show file tree
Hide file tree
Showing 12 changed files with 163 additions and 39 deletions.
21 changes: 21 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Contributing Guidelines

Contributing guidelines for open-source EK projects.

**IMPORTANT! Contribute your code only if you have an excellent understanding of project idea and all existing code base. Otherwise, a nicely formatted issue will be more helpful to us.**

### Issues

1. Provide product version where the problem was found;
2. Provide info about your environment;
3. Provide detailed info about your problem;
4. Provide steps to reproduce the problem;
5. Provide actual and expected results.

### Code

1. Check your code **before** creating pull request;
2. If tests are present in a project, add tests for your code;
3. Add inline documentation for your code;
4. Apply code style used throughout the project;
5. Create your pull request to `develop` branch (_pull requests to other branches are not allowed_).
54 changes: 54 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
_Before opening an issue, search for similar bug reports or feature requests on GitHub Issues. If yes, please add a_ 👍 _reaction to the existing issue. If no similar issue can be found, fill out either the "Bug Report" or the "Feature Request" section below. Erase the other section and everything on and above this line._

### Bug report

**System info:**

* **Version used (`grep 'VERSION' librato.go`):**
* **OS (`cat /etc/*-release`):**
* **Kernel (`uname -a`):**
* **Go version (`go version`):**
* **Install tools:**

**System info:**

1. [First Step]
2. [Second Step]
3. [and so on...]

**Expected behavior:**

[What you expected to happen]

**Actual behavior:**

[What actually happened]

**Additional info:**

[Include gist of relevant config, logs, etc.]

Please run those if possible and link them from a [gist](http://gist.github.com).

---

### Feature Request

Opening a feature request kicks off a discussion. Requests may be closed if we're not actively planning to work on them.

**Proposal:**

[Description of the feature]

**Current behavior:**

[What currently happens]

**Desired behavior:**

[What you would like to happen]

**Use case:**

[Why is this important (helps with prioritizing requests)]

24 changes: 24 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
### What did you implement:

Closes #XXXXX

### How did you implement it:

...

### How can we verify it:

...

### TODO's:

- [ ] Write tests
- [ ] Write documentation
- [ ] Check that there aren't other open pull requests for the same issue/feature
- [ ] Format your source code by `make fmt`
- [ ] Provide verification config / commands
- [ ] Enable "Allow edits from maintainers" for this PR
- [ ] Update the messages below

**Is this ready for review?:** No
**Is it a breaking change?:** No
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ matrix:
before_install:
- make deps
- mkdir -p $GOPATH/src/pkg.re/essentialkaos
- ln -sf $GOPATH/src/github.com/essentialkaos/librato $GOPATH/src/pkg.re/essentialkaos/librato.v6
- ln -sf $GOPATH/src/github.com/essentialkaos/librato $GOPATH/src/pkg.re/essentialkaos/librato.v7

script:
- go build examples/annotations_example.go
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
########################################################################################

# This Makefile generated by GoMakeGen 0.5.0 using next command:
# This Makefile generated by GoMakeGen 0.6.0 using next command:
# gomakegen --metalinter .

########################################################################################
Expand All @@ -11,7 +11,7 @@

deps:
git config --global http.https://pkg.re.followRedirects true
go get -d -v pkg.re/essentialkaos/ek.v8
go get -d -v pkg.re/essentialkaos/ek.v9

fmt:
find . -name "*.go" -exec gofmt -s -w {} \;
Expand Down
39 changes: 26 additions & 13 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,60 @@
## Changelog

#### v5.0.0
### 7.0.0

* `ek` package updated to v9

---

### 6.0.0

* `ek` package updated to v8
* Improved Makefile

---

#### 5.0.0

* `ek` package updated to v7

---

#### v4.1.0
#### 4.1.0

* `ek` package updated to v6

#### v4.0.0
#### 4.0.0

* Custom [ek](https://github.com/essentialkaos/ek) `req.Engine` support

---

#### v3.0.0
#### 3.0.0

* Each `Metrics` and `Collector` instance now have it's own `req.Engine` for sending requests
* EK package updated to v5

---

#### v2.0.5
#### 2.0.5

* Fixed error handling
* Improved error handling
* Code refactoring

#### v2.0.4
#### 2.0.4

* Improved error handling

#### v2.0.3
#### 2.0.3

* Global prefix feature removed

#### v2.0.1
#### 2.0.1

* EK package updated to latest version

#### v2.0.0
#### 2.0.0

* Added usage examples
* Using values instead pointers for measurements (gauge/counter) structs
Expand All @@ -50,20 +63,20 @@

---

#### v1.2.1
#### 1.2.1

* Added pkg.re usage

#### v1.2
#### 1.2.0

* Improved async data sending
* Fixed minor bug with getting EOF error

#### v1.1
#### 1.1.0

* Added `Collector` for collecting metrics for some period
* Some minor improvements

#### v1
#### 1.0.0

Initial public release
2 changes: 1 addition & 1 deletion examples/annotations_example.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"time"

"pkg.re/essentialkaos/librato.v6"
"pkg.re/essentialkaos/librato.v7"
)

// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
12 changes: 8 additions & 4 deletions examples/async_example.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ package main

import (
"fmt"
"math/rand"
"time"

"pkg.re/essentialkaos/ek.v8/rand"

"pkg.re/essentialkaos/librato.v6"
"pkg.re/essentialkaos/librato.v7"
)

// ////////////////////////////////////////////////////////////////////////////////// //
Expand All @@ -31,10 +30,15 @@ func main() {
metrics.Add(
librato.Gauge{
Name: "example:gauge_1",
Value: rand.Int(1000),
Value: randomInt(1000),
},
)

time.Sleep(15 * time.Second)
}
}

func randomInt(n int) int {
rand.Seed(time.Now().UTC().UnixNano())
return rand.Intn(n)
}
16 changes: 10 additions & 6 deletions examples/basic_example.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ package main

import (
"fmt"
"math/rand"
"time"

"pkg.re/essentialkaos/ek.v8/rand"

"pkg.re/essentialkaos/librato.v6"
"pkg.re/essentialkaos/librato.v7"
)

// ////////////////////////////////////////////////////////////////////////////////// //
Expand All @@ -21,16 +20,16 @@ func main() {
errs := librato.AddMetric(
librato.Gauge{
Name: "example:gauge_1",
Value: rand.Int(1000),
Value: randomInt(1000),
},
librato.Gauge{
Name: "example:gauge_2",
Value: float64(rand.Int(1000)) / 5.0,
Value: float64(randomInt(1000)) / 5.0,
Source: "go_librato_example",
},
librato.Counter{
Name: "example:counter_1",
Value: rand.Int(1000),
Value: randomInt(1000),
},
)

Expand All @@ -47,3 +46,8 @@ func main() {
time.Sleep(time.Minute)
}
}

func randomInt(n int) int {
rand.Seed(time.Now().UTC().UnixNano())
return rand.Intn(n)
}
16 changes: 10 additions & 6 deletions examples/collector_example.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ package main

import (
"fmt"
"math/rand"
"time"

"pkg.re/essentialkaos/ek.v8/rand"

"pkg.re/essentialkaos/librato.v6"
"pkg.re/essentialkaos/librato.v7"
)

// ////////////////////////////////////////////////////////////////////////////////// //
Expand All @@ -31,16 +30,16 @@ func collectSomeMetrics() []librato.Measurement {
return []librato.Measurement{
librato.Gauge{
Name: "example:gauge_1",
Value: rand.Int(1000),
Value: randomInt(1000),
},
librato.Gauge{
Name: "example:gauge_2",
Value: float64(rand.Int(1000)) / float64(rand.Int(20)),
Value: float64(randomInt(1000)) / float64(randomInt(20)),
Source: "go_librato_example",
},
librato.Counter{
Name: "example:counter_1",
Value: rand.Int(1000),
Value: randomInt(1000),
},
}
}
Expand All @@ -52,3 +51,8 @@ func errorHandler(errs []error) {
fmt.Printf(" %v\n", err)
}
}

func randomInt(n int) int {
rand.Seed(time.Now().UTC().UnixNano())
return rand.Intn(n)
}
6 changes: 3 additions & 3 deletions librato.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ import (
"strings"
"time"

"pkg.re/essentialkaos/ek.v8/req"
"pkg.re/essentialkaos/ek.v8/timeutil"
"pkg.re/essentialkaos/ek.v9/req"
"pkg.re/essentialkaos/ek.v9/timeutil"
)

// ////////////////////////////////////////////////////////////////////////////////// //

// VERSION contains current version of librato package and used as part of User-Agent
const VERSION = "6.0.0"
const VERSION = "7.0.0"

// ////////////////////////////////////////////////////////////////////////////////// //

Expand Down
6 changes: 3 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Librato [![GoDoc](https://godoc.org/pkg.re/essentialkaos/librato.v6?status.svg)](https://godoc.org/pkg.re/essentialkaos/librato.v6) [![Build Status](https://travis-ci.org/essentialkaos/librato.svg?branch=master)](https://travis-ci.org/essentialkaos/librato) [![Go Report Card](https://goreportcard.com/badge/github.com/essentialkaos/librato)](https://goreportcard.com/report/github.com/essentialkaos/librato) [![codebeat badge](https://codebeat.co/badges/f82e704d-67a7-4c6f-9e5d-1acf058c937b)](https://codebeat.co/projects/github-com-essentialkaos-librato) [![License](https://gh.kaos.io/ekol.svg)](https://essentialkaos.com/ekol)
# Librato [![GoDoc](https://godoc.org/pkg.re/essentialkaos/librato.v7?status.svg)](https://godoc.org/pkg.re/essentialkaos/librato.v7) [![Build Status](https://travis-ci.org/essentialkaos/librato.svg?branch=master)](https://travis-ci.org/essentialkaos/librato) [![Go Report Card](https://goreportcard.com/badge/github.com/essentialkaos/librato)](https://goreportcard.com/report/github.com/essentialkaos/librato) [![codebeat badge](https://codebeat.co/badges/f82e704d-67a7-4c6f-9e5d-1acf058c937b)](https://codebeat.co/projects/github-com-essentialkaos-librato) [![License](https://gh.kaos.io/ekol.svg)](https://essentialkaos.com/ekol)

Package for working with [Librato Metrics](https://www.librato.com) API from Go code.

Expand All @@ -13,13 +13,13 @@ git config --global http.https://pkg.re.followRedirects true
Make sure you have a working Go 1.6+ workspace ([instructions](https://golang.org/doc/install)), then

```
go get pkg.re/essentialkaos/librato.v6
go get pkg.re/essentialkaos/librato.v7
```

For update to latest stable release, do:

```
go get -u pkg.re/essentialkaos/librato.v6
go get -u pkg.re/essentialkaos/librato.v7
```

## Examples
Expand Down

0 comments on commit d135fc7

Please sign in to comment.