-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Feature parity between Python disk check and Go disk check #33116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 181 commits
5321bc8
2cebed1
df8d05b
5ed612e
48b78e0
2a2142d
f145f53
447c523
8fb789f
1e6b88c
cc5c03c
59e568c
8c98e0f
56b2fc5
e2abd45
b514223
479c31b
ddd7058
8b1d5fb
7e7112f
931e6c1
28588f1
54b6415
1220c2d
d83947b
2b17c42
5773ad9
e458c39
fda63ce
e0f1c42
60ce0ff
30ab96b
17ea573
47b8407
d0fb680
e655942
096c7a5
835a461
cedcb2b
a53f049
6e95e4c
280d939
93d4b35
ec812d4
fc326c9
d2cc47d
a18c176
c3678ee
430f09d
cd36d33
56e3250
47328a1
789ebd9
5b7d280
eaae963
c0efc48
22fa311
f5c2cd2
7358e41
6f9757e
a103522
e91c367
406ee23
a1db57e
cf53230
1a297ae
36bdaf4
2226c50
82cf824
6625b63
46f5713
1cc2d0d
d0da6b8
94c143c
591e5dd
fec08f1
102681f
3129ef8
6a8653b
635c68d
a3ab0fd
efddc0d
8054c4e
33469ed
5f4fcf3
e1f5484
b600c2e
63ded7e
f8441b5
4c0c1be
e8f30a4
ca2e61c
e964ab4
9deeb1a
38b985e
61f85fa
8eb5fc0
cb1d7ca
ba6568b
3ea5f79
314a7e9
b1cef97
bf88dc1
8f65909
1649760
a3877e0
45ee528
8808c79
edbcd62
1da5481
dbfd9bf
01d20bc
ca42641
168bc20
31b349f
3e75264
375c4cc
3324ba8
37b3c0f
0de301d
515b5fc
c264205
f82740f
66dd905
18ef777
a6bf013
1eea9d8
b1ad617
1ca00b2
b85dd06
50ba0ad
67351c6
ea71057
fdedd64
a16dbf0
e4f9498
a8d7c48
4827701
afc9388
c724ac9
8f1b3f0
d4d65b3
ad35774
f1b0584
2db79ef
41fcd5f
35c2879
df4d6ac
3e359c7
b9d7f08
ef48fd5
5fea541
9ab049f
84d31c6
27a589e
32c31b5
b8cf023
4523119
e5422d4
20be185
e8f7cbe
c967a37
2472848
0fd01c4
ef2bb7a
1c114ed
df5138c
d31c54c
17245f2
6eb9a67
2dcde71
3ccd034
8af93c8
e6c716a
08372e0
53ad66f
c465d67
a94ac80
a8ff7f6
8593390
a7d157a
2fcd4d7
5af9363
a91cc30
a77bee4
7728bac
f0a9721
b9d3a46
0cee8f0
fa784b0
d52e624
3045a72
0711e50
17f67b2
8e49460
40830e8
bce779a
9d08b86
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,6 +121,7 @@ import ( | |
"github.com/DataDog/datadog-agent/pkg/collector/corechecks/cluster/orchestrator" | ||
"github.com/DataDog/datadog-agent/pkg/collector/corechecks/system/cpu/cpu" | ||
"github.com/DataDog/datadog-agent/pkg/collector/corechecks/system/disk/disk" | ||
"github.com/DataDog/datadog-agent/pkg/collector/corechecks/system/disk/diskv2" | ||
"github.com/DataDog/datadog-agent/pkg/collector/corechecks/system/disk/io" | ||
"github.com/DataDog/datadog-agent/pkg/collector/corechecks/system/filehandles" | ||
"github.com/DataDog/datadog-agent/pkg/collector/corechecks/system/memory" | ||
|
@@ -631,7 +632,11 @@ func registerChecks(wlm workloadmeta.Component, tagger tagger.Component, cfg con | |
corecheckLoader.RegisterCheck(kubernetesapiserver.CheckName, kubernetesapiserver.Factory(tagger)) | ||
corecheckLoader.RegisterCheck(ksm.CheckName, ksm.Factory()) | ||
corecheckLoader.RegisterCheck(helm.CheckName, helm.Factory()) | ||
corecheckLoader.RegisterCheck(disk.CheckName, disk.Factory()) | ||
if cfg.GetBool("use_diskv2_check") { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know it was already there but I'm a bit confused by this one because there's not Python interpreter in the cluster-agent. The disk check is not run according to the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't have all the context but fyi the disk check already had a Go implementation (used at least for the iot agent) so maybe that's what was used There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To be honest, I don't know if it runs by default on the cluster-agent or not, but in the worst case this change would keep the current behavior since |
||
corecheckLoader.RegisterCheck(disk.CheckName, diskv2.Factory()) | ||
} else { | ||
corecheckLoader.RegisterCheck(disk.CheckName, disk.Factory()) | ||
} | ||
corecheckLoader.RegisterCheck(orchestrator.CheckName, orchestrator.Factory(wlm, cfg, tagger)) | ||
corecheckLoader.RegisterCheck(winproc.CheckName, winproc.Factory()) | ||
} |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could use |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Unless explicitly stated otherwise all files in this repository are licensed | ||
// under the Apache License Version 2.0. | ||
// This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
// Copyright 2016-present Datadog, Inc. | ||
|
||
// Package diskv2 provides Disk Check. | ||
package diskv2 | ||
|
||
import "time" | ||
|
||
// Clock abstracts time-related functions used in the package. | ||
type Clock interface { | ||
// After returns a channel that will send the current time after the specified duration. | ||
After(d time.Duration) <-chan time.Time | ||
} | ||
|
||
// RealClock is the production implementation that wraps time.After. | ||
type RealClock struct{} | ||
|
||
// After returns the channel from time.After. | ||
func (rc *RealClock) After(d time.Duration) <-chan time.Time { | ||
return time.After(d) | ||
} | ||
|
||
// FakeClock is used in unit tests. | ||
type FakeClock struct { | ||
AfterCh chan time.Time | ||
} | ||
|
||
// After returns the controlled channel. | ||
func (fc *FakeClock) After(_ time.Duration) <-chan time.Time { | ||
return fc.AfterCh | ||
} |
Uh oh!
There was an error while loading. Please reload this page.