Ran go fmt on opentsdb sources.

This commit is contained in:
Eric 2016-07-22 08:29:55 -04:00
parent 71c53841c3
commit 8ab9cc29af
3 changed files with 104 additions and 105 deletions

View File

@ -47,6 +47,7 @@ var sampleConfig = `
## Debug true - Prints OpenTSDB communication
debug = false
`
type TagSet map[string]string
func (t TagSet) ToLineFormat() string {

View File

@ -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())

View File

@ -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, "{}")