Ran go fmt on opentsdb sources.
This commit is contained in:
parent
71c53841c3
commit
8ab9cc29af
|
@ -47,6 +47,7 @@ var sampleConfig = `
|
|||
## Debug true - Prints OpenTSDB communication
|
||||
debug = false
|
||||
`
|
||||
|
||||
type TagSet map[string]string
|
||||
|
||||
func (t TagSet) ToLineFormat() string {
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
package opentsdb
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"bytes"
|
||||
"compress/gzip"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
"net/http/httputil"
|
||||
"net/url"
|
||||
"bytes"
|
||||
"compress/gzip"
|
||||
"log"
|
||||
)
|
||||
|
||||
type HttpMetric struct {
|
||||
|
@ -20,7 +20,6 @@ type HttpMetric struct {
|
|||
Tags map[string]string `json:"tags"`
|
||||
}
|
||||
|
||||
|
||||
type openTSDBHttp struct {
|
||||
Host string
|
||||
Port int
|
||||
|
@ -124,7 +123,7 @@ func (o *openTSDBHttp) flush() error {
|
|||
Path: "/api/put",
|
||||
}
|
||||
|
||||
if (o.Debug) {
|
||||
if o.Debug {
|
||||
u.RawQuery = "details"
|
||||
}
|
||||
|
||||
|
@ -135,7 +134,7 @@ func (o *openTSDBHttp) flush() error {
|
|||
req.Header.Set("Content-Type", "applicaton/json")
|
||||
req.Header.Set("Content-Encoding", "gzip")
|
||||
|
||||
if (o.Debug) {
|
||||
if o.Debug {
|
||||
dump, err := httputil.DumpRequestOut(req, false)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error when dumping request: %s", err.Error())
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
package opentsdb
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"net/url"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"testing"
|
||||
|
||||
"github.com/influxdata/telegraf"
|
||||
"github.com/influxdata/telegraf/testutil"
|
||||
|
@ -83,7 +83,6 @@ func BenchmarkHttpSend(b *testing.B) {
|
|||
metrics[i] = testutil.TestMetric(1.0)
|
||||
}
|
||||
|
||||
|
||||
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
fmt.Fprintln(w, "{}")
|
||||
|
|
Loading…
Reference in New Issue