Skip to content

Commit

Permalink
Use internal.Duration for jolokia timeouts (#4136)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnelson authored May 12, 2018
1 parent 2add516 commit 5b59933
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions plugins/inputs/jolokia2/jolokia_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package jolokia2
import (
"fmt"
"sync"
"time"

"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/internal"
"github.com/influxdata/telegraf/internal/tls"
)

Expand All @@ -17,7 +17,7 @@ type JolokiaAgent struct {
URLs []string `toml:"urls"`
Username string
Password string
ResponseTimeout time.Duration `toml:"response_timeout"`
ResponseTimeout internal.Duration `toml:"response_timeout"`

tls.ClientConfig

Expand Down Expand Up @@ -101,7 +101,7 @@ func (ja *JolokiaAgent) createClient(url string) (*Client, error) {
return NewClient(url, &ClientConfig{
Username: ja.Username,
Password: ja.Password,
ResponseTimeout: ja.ResponseTimeout,
ResponseTimeout: ja.ResponseTimeout.Duration,
ClientConfig: ja.ClientConfig,
})
}
7 changes: 3 additions & 4 deletions plugins/inputs/jolokia2/jolokia_proxy.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package jolokia2

import (
"time"

"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/internal"
"github.com/influxdata/telegraf/internal/tls"
)

Expand All @@ -19,7 +18,7 @@ type JolokiaProxy struct {

Username string
Password string
ResponseTimeout time.Duration `toml:"response_timeout"`
ResponseTimeout internal.Duration `toml:"response_timeout"`
tls.ClientConfig

Metrics []MetricConfig `toml:"metric"`
Expand Down Expand Up @@ -117,7 +116,7 @@ func (jp *JolokiaProxy) createClient() (*Client, error) {
return NewClient(jp.URL, &ClientConfig{
Username: jp.Username,
Password: jp.Password,
ResponseTimeout: jp.ResponseTimeout,
ResponseTimeout: jp.ResponseTimeout.Duration,
ClientConfig: jp.ClientConfig,
ProxyConfig: proxyConfig,
})
Expand Down

0 comments on commit 5b59933

Please sign in to comment.