Skip to content
Snippets Groups Projects
Unverified Commit 5b599337 authored by Daniel Nelson's avatar Daniel Nelson Committed by GitHub
Browse files

Use internal.Duration for jolokia timeouts (#4136)

parent 2add516e
No related branches found
No related tags found
No related merge requests found
...@@ -3,9 +3,9 @@ package jolokia2 ...@@ -3,9 +3,9 @@ package jolokia2
import ( import (
"fmt" "fmt"
"sync" "sync"
"time"
"github.com/influxdata/telegraf" "github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/internal"
"github.com/influxdata/telegraf/internal/tls" "github.com/influxdata/telegraf/internal/tls"
) )
...@@ -17,7 +17,7 @@ type JolokiaAgent struct { ...@@ -17,7 +17,7 @@ type JolokiaAgent struct {
URLs []string `toml:"urls"` URLs []string `toml:"urls"`
Username string Username string
Password string Password string
ResponseTimeout time.Duration `toml:"response_timeout"` ResponseTimeout internal.Duration `toml:"response_timeout"`
tls.ClientConfig tls.ClientConfig
...@@ -101,7 +101,7 @@ func (ja *JolokiaAgent) createClient(url string) (*Client, error) { ...@@ -101,7 +101,7 @@ func (ja *JolokiaAgent) createClient(url string) (*Client, error) {
return NewClient(url, &ClientConfig{ return NewClient(url, &ClientConfig{
Username: ja.Username, Username: ja.Username,
Password: ja.Password, Password: ja.Password,
ResponseTimeout: ja.ResponseTimeout, ResponseTimeout: ja.ResponseTimeout.Duration,
ClientConfig: ja.ClientConfig, ClientConfig: ja.ClientConfig,
}) })
} }
package jolokia2 package jolokia2
import ( import (
"time"
"github.com/influxdata/telegraf" "github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/internal"
"github.com/influxdata/telegraf/internal/tls" "github.com/influxdata/telegraf/internal/tls"
) )
...@@ -19,7 +18,7 @@ type JolokiaProxy struct { ...@@ -19,7 +18,7 @@ type JolokiaProxy struct {
Username string Username string
Password string Password string
ResponseTimeout time.Duration `toml:"response_timeout"` ResponseTimeout internal.Duration `toml:"response_timeout"`
tls.ClientConfig tls.ClientConfig
Metrics []MetricConfig `toml:"metric"` Metrics []MetricConfig `toml:"metric"`
...@@ -117,7 +116,7 @@ func (jp *JolokiaProxy) createClient() (*Client, error) { ...@@ -117,7 +116,7 @@ func (jp *JolokiaProxy) createClient() (*Client, error) {
return NewClient(jp.URL, &ClientConfig{ return NewClient(jp.URL, &ClientConfig{
Username: jp.Username, Username: jp.Username,
Password: jp.Password, Password: jp.Password,
ResponseTimeout: jp.ResponseTimeout, ResponseTimeout: jp.ResponseTimeout.Duration,
ClientConfig: jp.ClientConfig, ClientConfig: jp.ClientConfig,
ProxyConfig: proxyConfig, ProxyConfig: proxyConfig,
}) })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment