diff options
Diffstat (limited to 'src/go/plugin/go.d/modules/memcached')
-rw-r--r-- | src/go/plugin/go.d/modules/memcached/client.go | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/memcached/integrations/memcached.md | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/memcached/memcached.go | 14 |
3 files changed, 10 insertions, 14 deletions
diff --git a/src/go/plugin/go.d/modules/memcached/client.go b/src/go/plugin/go.d/modules/memcached/client.go index 679e3eb0..b6bab9bf 100644 --- a/src/go/plugin/go.d/modules/memcached/client.go +++ b/src/go/plugin/go.d/modules/memcached/client.go @@ -11,10 +11,8 @@ import ( func newMemcachedConn(conf Config) memcachedConn { return &memcachedClient{conn: socket.New(socket.Config{ - Address: conf.Address, - ConnectTimeout: conf.Timeout.Duration(), - ReadTimeout: conf.Timeout.Duration(), - WriteTimeout: conf.Timeout.Duration(), + Address: conf.Address, + Timeout: conf.Timeout.Duration(), })} } diff --git a/src/go/plugin/go.d/modules/memcached/integrations/memcached.md b/src/go/plugin/go.d/modules/memcached/integrations/memcached.md index 1e653902..86fb38c6 100644 --- a/src/go/plugin/go.d/modules/memcached/integrations/memcached.md +++ b/src/go/plugin/go.d/modules/memcached/integrations/memcached.md @@ -106,8 +106,8 @@ No action required. The configuration file name for this integration is `go.d/memcached.conf`. -You can edit the configuration file using the `edit-config` script from the -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). +You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script from the +Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata diff --git a/src/go/plugin/go.d/modules/memcached/memcached.go b/src/go/plugin/go.d/modules/memcached/memcached.go index bd6039ae..a823a9d3 100644 --- a/src/go/plugin/go.d/modules/memcached/memcached.go +++ b/src/go/plugin/go.d/modules/memcached/memcached.go @@ -8,7 +8,7 @@ import ( "time" "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" - "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/confopt" ) //go:embed "config_schema.json" @@ -26,7 +26,7 @@ func New() *Memcached { return &Memcached{ Config: Config{ Address: "127.0.0.1:11211", - Timeout: web.Duration(time.Second * 1), + Timeout: confopt.Duration(time.Second * 1), }, newMemcachedConn: newMemcachedConn, charts: charts.Copy(), @@ -34,9 +34,9 @@ func New() *Memcached { } type Config struct { - UpdateEvery int `yaml:"update_every,omitempty" json:"update_every"` - Address string `yaml:"address" json:"address"` - Timeout web.Duration `yaml:"timeout" json:"timeout"` + UpdateEvery int `yaml:"update_every,omitempty" json:"update_every"` + Address string `yaml:"address" json:"address"` + Timeout confopt.Duration `yaml:"timeout" json:"timeout"` } type ( @@ -62,8 +62,7 @@ func (m *Memcached) Configuration() any { func (m *Memcached) Init() error { if m.Address == "" { - m.Error("config: 'address' not set") - return errors.New("address not set") + return errors.New("config: 'address' not set") } return nil @@ -72,7 +71,6 @@ func (m *Memcached) Init() error { func (m *Memcached) Check() error { mx, err := m.collect() if err != nil { - m.Error(err) return err } |