Skip to content

Commit

Permalink
start refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
arkady-emelyanov committed May 18, 2018
1 parent 4da301c commit 6061716
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
14 changes: 3 additions & 11 deletions plugins/inputs/burrow/burrow.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,6 @@ type (
MaxConcurrentConnections int `toml:"max_concurrent_connections"`
WorkerQueueLength int `toml:"worker_queue_length"`

// log requests and status codes
Debug bool

// Path to CA file
SSLCA string `toml:"ssl_ca"`
// Path to host cert file
Expand All @@ -111,16 +108,12 @@ type (

func init() {
inputs.Add("burrow", func() telegraf.Input {
return getPlugin()
return &burrow{
WorkerQueueLength: 5,
}
})
}

func getPlugin() *burrow {
return &burrow{
WorkerQueueLength: 5,
}
}

func (b *burrow) SampleConfig() string {
return configSample
}
Expand Down Expand Up @@ -234,7 +227,6 @@ func (b *burrow) getClient(acc telegraf.Accumulator, addr string, errorChan chan
Timeout: b.Timeout.Duration,
},

debug: b.Debug,
acc: acc,
apiPrefix: b.APIPrefix,
baseURL: fmt.Sprintf("%s://%s", u.Scheme, u.Host),
Expand Down
4 changes: 0 additions & 4 deletions plugins/inputs/burrow/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"errors"
"fmt"
"io/ioutil"
"log"
"net/http"

"github.com/influxdata/telegraf"
Expand Down Expand Up @@ -137,9 +136,6 @@ func (api *apiClient) call(uri string) (apiResponse, error) {
return br, err
}

if api.debug {
log.Printf("D! call: %s, code: %d\n", req.URL.String(), res.StatusCode)
}
if res.StatusCode != http.StatusOK {
return br, fmt.Errorf("endpoint: '%s', invalid response code: '%d'", uri, res.StatusCode)
}
Expand Down

0 comments on commit 6061716

Please sign in to comment.