jolokia: run fmt

This commit is contained in:
Simone Aiello 2016-04-15 00:49:06 +02:00
parent 83aa86c404
commit 5e9980f263
2 changed files with 13 additions and 16 deletions

View File

@ -1,6 +1,7 @@
package jolokia package jolokia
import ( import (
"bytes"
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
@ -8,7 +9,6 @@ import (
"net/http" "net/http"
"net/url" "net/url"
"time" "time"
"bytes"
"github.com/influxdata/telegraf" "github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs" "github.com/influxdata/telegraf/plugins/inputs"
@ -142,7 +142,6 @@ func (j *Jolokia) doRequest(req *http.Request) (map[string]interface{}, error) {
return jsonOut, nil return jsonOut, nil
} }
func (j *Jolokia) prepareRequest(server Server, metric Metric) (*http.Request, error) { func (j *Jolokia) prepareRequest(server Server, metric Metric) (*http.Request, error) {
var jolokiaUrl *url.URL var jolokiaUrl *url.URL
context := j.Context // Usually "/jolokia" context := j.Context // Usually "/jolokia"
@ -161,7 +160,7 @@ func (j *Jolokia) prepareRequest(server Server, metric Metric) (*http.Request, e
} }
// Add target, only in proxy mode // Add target, only in proxy mode
if ( j.Mode == "proxy") { if j.Mode == "proxy" {
serviceUrl := fmt.Sprintf("service:jmx:rmi:///jndi/rmi://%s:%s/jmxrmi", server.Host, server.Port) serviceUrl := fmt.Sprintf("service:jmx:rmi:///jndi/rmi://%s:%s/jmxrmi", server.Host, server.Port)
@ -217,7 +216,6 @@ func (j *Jolokia) prepareRequest(server Server, metric Metric) (*http.Request, e
return req, nil return req, nil
} }
func (j *Jolokia) Gather(acc telegraf.Accumulator) error { func (j *Jolokia) Gather(acc telegraf.Accumulator) error {
servers := j.Servers servers := j.Servers
metrics := j.Metrics metrics := j.Metrics

View File

@ -117,7 +117,6 @@ func TestHttpJsonOn404(t *testing.T) {
assert.Equal(t, 0, len(acc.Metrics)) assert.Equal(t, 0, len(acc.Metrics))
} }
// Test that the proper values are ignored or collected // Test that the proper values are ignored or collected
func TestHttpInvalidJson(t *testing.T) { func TestHttpInvalidJson(t *testing.T) {