Use internal.Duration for jolokia timeouts (#4136)
(cherry picked from commit 5b599337a3
)
This commit is contained in:
parent
c9c53cf629
commit
649d840441
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
||||||
type JolokiaAgent struct {
|
type JolokiaAgent struct {
|
||||||
|
@ -16,7 +16,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"`
|
||||||
|
|
||||||
SSLCA string `toml:"ssl_ca"`
|
SSLCA string `toml:"ssl_ca"`
|
||||||
SSLCert string `toml:"ssl_cert"`
|
SSLCert string `toml:"ssl_cert"`
|
||||||
|
@ -103,7 +103,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,
|
||||||
SSLCA: ja.SSLCA,
|
SSLCA: ja.SSLCA,
|
||||||
SSLCert: ja.SSLCert,
|
SSLCert: ja.SSLCert,
|
||||||
SSLKey: ja.SSLKey,
|
SSLKey: ja.SSLKey,
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
package jolokia2
|
package jolokia2
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
|
"github.com/influxdata/telegraf/internal"
|
||||||
)
|
)
|
||||||
|
|
||||||
type JolokiaProxy struct {
|
type JolokiaProxy struct {
|
||||||
|
@ -22,7 +21,7 @@ type JolokiaProxy struct {
|
||||||
SSLCert string `toml:"ssl_cert"`
|
SSLCert string `toml:"ssl_cert"`
|
||||||
SSLKey string `toml:"ssl_key"`
|
SSLKey string `toml:"ssl_key"`
|
||||||
InsecureSkipVerify bool
|
InsecureSkipVerify bool
|
||||||
ResponseTimeout time.Duration `toml:"response_timeout"`
|
ResponseTimeout internal.Duration `toml:"response_timeout"`
|
||||||
|
|
||||||
Metrics []MetricConfig `toml:"metric"`
|
Metrics []MetricConfig `toml:"metric"`
|
||||||
client *Client
|
client *Client
|
||||||
|
@ -119,7 +118,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,
|
||||||
SSLCA: jp.SSLCA,
|
SSLCA: jp.SSLCA,
|
||||||
SSLCert: jp.SSLCert,
|
SSLCert: jp.SSLCert,
|
||||||
SSLKey: jp.SSLKey,
|
SSLKey: jp.SSLKey,
|
||||||
|
|
Loading…
Reference in New Issue