Refactor based on goreportcard.com

This commit is contained in:
Matej Kramny
2015-03-20 20:40:16 +01:00
parent 8e17ebceef
commit 3d0b0c88e1
7 changed files with 55 additions and 38 deletions

View File

@@ -6,8 +6,9 @@ import (
"encoding/json"
)
func SendMetric(metricId int, delay int64) {
if metricId <= 0 {
// Send lag metric point
func SendMetric(metricID int, delay int64) {
if metricID <= 0 {
return
}
@@ -15,7 +16,7 @@ func SendMetric(metricId int, delay int64) {
"value": delay,
})
resp, _, err := makeRequest("POST", "/metrics/" + strconv.Itoa(metricId) + "/points", jsonBytes)
resp, _, err := makeRequest("POST", "/metrics/" + strconv.Itoa(metricID) + "/points", jsonBytes)
if err != nil || resp.StatusCode != 200 {
fmt.Printf("Could not log data point!\n%v\n", err)
return