Skip to content

Commit 4d9b4cf

Browse files
committed
use storer from sdk
1 parent a573263 commit 4d9b4cf

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

src/config/config.go

-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,4 @@ type ArgumentList struct {
1414
// CgroupPath and CgroupDriver arguments are not used but are kept here for backwards compatibility reasons.
1515
CgroupPath string `default:"" help:"Deprecated. cgroup_path argument is not used anymore."`
1616
CgroupDriver string `default:"" help:"Deprecated. cgroup_driver argument is not used anymore."`
17-
18-
CacheTTL string `default:"1m" help:"Set the maximum cache TTL that the integration is going to use to calculate rates and deltas. Possible values are time-strings: 1s, 1m, 1h"`
1917
}

src/nri/sampler.go

+1-6
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ type ContainerSampler struct {
3838

3939
// NewSampler returns a ContainerSampler instance.
4040
func NewSampler(fetcher raw.Fetcher, docker raw.DockerClient, config config.ArgumentList) (*ContainerSampler, error) {
41-
cacheTTL, err := time.ParseDuration(config.CacheTTL)
42-
if err != nil {
43-
return nil, err
44-
}
45-
4641
exitedContainerTTL, err := time.ParseDuration(config.ExitedContainersTTL)
4742
if err != nil {
4843
return nil, err
@@ -52,7 +47,7 @@ func NewSampler(fetcher raw.Fetcher, docker raw.DockerClient, config config.Argu
5247
store, err := persist.NewFileStore(
5348
persist.TmpPath(config.TempDir, "container_cpus"),
5449
log.NewStdErr(true),
55-
cacheTTL)
50+
config.CacheTTL)
5651
if err != nil {
5752
return nil, err
5853
}

0 commit comments

Comments
 (0)