go fmt run over jolokia.go

This commit is contained in:
saiello 2015-10-29 14:48:39 +01:00 committed by Cameron Sparr
parent 40d8aeecb0
commit 62270a3697
1 changed files with 71 additions and 78 deletions

View File

@ -13,7 +13,6 @@ import (
"github.com/influxdb/telegraf/plugins" "github.com/influxdb/telegraf/plugins"
) )
type Server struct { type Server struct {
Name string Name string
Host string Host string
@ -28,14 +27,12 @@ type Metric struct {
} }
type Jolokia struct { type Jolokia struct {
Context string Context string
Servers []Server Servers []Server
Metrics []Metric Metrics []Metric
Tags map[string]string Tags map[string]string
} }
func (j *Jolokia) SampleConfig() string { func (j *Jolokia) SampleConfig() string {
return `[jolokia] return `[jolokia]
context = "/jolokia/read" context = "/jolokia/read"
@ -70,8 +67,6 @@ func (j *Jolokia) Description() string {
return "Read JMX metrics through Jolokia" return "Read JMX metrics through Jolokia"
} }
func getAttr(requestUrl *url.URL) (map[string]interface{}, error) { func getAttr(requestUrl *url.URL) (map[string]interface{}, error) {
//make request //make request
resp, err := http.Get(requestUrl.String()) resp, err := http.Get(requestUrl.String())
@ -144,7 +139,6 @@ func (m *Metric) filterFields(fields map[string]interface{}) map[string]interfac
return fields return fields
} }
func (j *Jolokia) Gather(acc plugins.Accumulator) error { func (j *Jolokia) Gather(acc plugins.Accumulator) error {
context := j.Context //"/jolokia/read" context := j.Context //"/jolokia/read"
@ -156,7 +150,6 @@ func (j *Jolokia) Gather(acc plugins.Accumulator) error {
tags = map[string]string{} tags = map[string]string{}
} }
for _, server := range servers { for _, server := range servers {
for _, metric := range metrics { for _, metric := range metrics {