format code for CI
This commit is contained in:
parent
3c211a6deb
commit
864177a850
|
@ -1,18 +1,18 @@
|
|||
package graylog
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"bytes"
|
||||
"regexp"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/influxdata/telegraf"
|
||||
"github.com/influxdata/telegraf/internal"
|
||||
|
@ -222,7 +222,7 @@ func (h *GrayLog) gatherServer(
|
|||
for k, v := range metric.Fields() {
|
||||
re, _ := regexp.Compile(`metrics_([0-9]+)`)
|
||||
match := re.FindAllStringSubmatch(k, -1)
|
||||
if(match != nil) {
|
||||
if match != nil {
|
||||
i, _ := strconv.Atoi(match[0][1])
|
||||
fields[name_list[i]] = v
|
||||
}
|
||||
|
|
|
@ -36,7 +36,6 @@ const validJSON = `
|
|||
]
|
||||
}`
|
||||
|
||||
|
||||
var expectedFields = map[string]interface{}{
|
||||
"jvm.memory.pools.Metaspace.committed": float64(108040192),
|
||||
"jvm.cl.loaded": float64(18910),
|
||||
|
@ -152,7 +151,6 @@ func TestNormalResponse(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// Test response to HTTP 500
|
||||
func TestHttpJson500(t *testing.T) {
|
||||
graylog := genMockGrayLog(validJSON, 500)
|
||||
|
|
Loading…
Reference in New Issue