diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-26 08:15:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-26 08:15:20 +0000 |
commit | 87d772a7d708fec12f48cd8adc0dedff6e1025da (patch) | |
tree | 1fee344c64cc3f43074a01981e21126c8482a522 /src/go/collectors/go.d.plugin/modules/chrony/chrony.go | |
parent | Adding upstream version 1.46.3. (diff) | |
download | netdata-upstream.tar.xz netdata-upstream.zip |
Adding upstream version 1.47.0.upstream/1.47.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | src/go/plugin/go.d/modules/chrony/chrony.go (renamed from src/go/collectors/go.d.plugin/modules/chrony/chrony.go) | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/go/collectors/go.d.plugin/modules/chrony/chrony.go b/src/go/plugin/go.d/modules/chrony/chrony.go index eb51c4105..0bdd3183c 100644 --- a/src/go/collectors/go.d.plugin/modules/chrony/chrony.go +++ b/src/go/plugin/go.d/modules/chrony/chrony.go @@ -5,11 +5,13 @@ package chrony import ( _ "embed" "errors" + "sync" "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/facebook/time/ntp/chrony" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" ) //go:embed "config_schema.json" @@ -29,8 +31,9 @@ func New() *Chrony { Address: "127.0.0.1:323", Timeout: web.Duration(time.Second), }, - charts: charts.Copy(), - newClient: newChronyClient, + charts: charts.Copy(), + addStatsChartsOnce: &sync.Once{}, + newClient: newChronyClient, } } @@ -45,7 +48,8 @@ type ( module.Base Config `yaml:",inline" json:""` - charts *module.Charts + charts *module.Charts + addStatsChartsOnce *sync.Once client chronyClient newClient func(c Config) (chronyClient, error) @@ -53,6 +57,7 @@ type ( chronyClient interface { Tracking() (*chrony.ReplyTracking, error) Activity() (*chrony.ReplyActivity, error) + ServerStats() (*serverStats, error) Close() } ) |