Skip to content
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

DAOS-16451 telemetry: Adjust type of (_sum|_sumsquares) #15028

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/control/lib/telemetry/promexp/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,16 +141,18 @@ func getMetricStats(baseName string, m telemetry.Metric) (stats []*metricStat) {
desc: " (mean)",
},
"sum": {
fn: func() float64 { return float64(ms.Sum()) },
desc: " (sum)",
fn: func() float64 { return float64(ms.Sum()) },
isCounter: true,
desc: " (sum)",
},
"stddev": {
fn: ms.StdDev,
desc: " (std dev)",
},
"sumsquares": {
fn: ms.SumSquares,
desc: " (sum of squares)",
fn: ms.SumSquares,
isCounter: true,
desc: " (sum of squares)",
},
"samples": {
fn: func() float64 { return float64(ms.SampleSize()) },
Expand Down
14 changes: 8 additions & 6 deletions src/control/lib/telemetry/promexp/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,10 @@ func TestPromExp_getMetricStats(t *testing.T) {
value: 3.0,
},
{
name: "stats_gauge_sum",
desc: " (sum)",
value: 15.0,
name: "stats_gauge_sum",
desc: " (sum)",
value: 15.0,
isCounter: true,
},
{
name: "stats_gauge_samples",
Expand All @@ -104,9 +105,10 @@ func TestPromExp_getMetricStats(t *testing.T) {
value: 1.58113883,
},
{
name: "stats_gauge_sumsquares",
desc: " (sum of squares)",
value: 55,
name: "stats_gauge_sumsquares",
desc: " (sum of squares)",
value: 55,
isCounter: true,
},
},
},
Expand Down
4 changes: 4 additions & 0 deletions src/control/security/pem_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ func TestSecurity_Pem_ValidateCertDirectory(t *testing.T) {
if err := os.Mkdir(testDir, tc.perms); err != nil {
t.Fatal(err)
}
// Use chmod to set the permissions regardless of umask.
if err := os.Chmod(testDir, tc.perms); err != nil {
t.Fatal(err)
}
testFile := test.CreateTestFile(t, dir, "some content")

path := testDir
Expand Down
Loading