-
Notifications
You must be signed in to change notification settings - Fork 77
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
implement malloc metrics #2161
implement malloc metrics #2161
Conversation
[CHATOPS:HELP] ChatOps commands.
|
internal/core/malloc/malloc_test.go
Outdated
return nil | ||
} | ||
tests := []test{ | ||
// TODO test cases |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
internal/core/malloc/malloc_test.go:37: Line contains TODO/BUG/FIXME: "TODO test cases" (godox)
}, nil | ||
} | ||
|
||
func (mm *mallocMetrics) Register(m metrics.Meter) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
ST1016: methods on the same type should have the same receiver name (seen 1x "m", 1x "mm") (stylecheck)
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2161 +/- ##
==========================================
+ Coverage 29.80% 30.03% +0.23%
==========================================
Files 372 371 -1
Lines 36372 36089 -283
==========================================
- Hits 10840 10839 -1
+ Misses 25019 24737 -282
Partials 513 513 ☔ View full report in Codecov by Sentry. |
Deploying with Cloudflare Pages
|
7c60cb8
to
f77d5e4
Compare
40bf9ac
to
5984b75
Compare
4326104
to
7a751e6
Compare
3ad5912
to
94ff86c
Compare
numGC.Observe(ctx, int64(mstats.NextGC)) | ||
numGC.Observe(ctx, int64(mstats.NumGC)) | ||
numForcedGC.Observe(ctx, int64(mstats.NumForcedGC)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
File is not gofumpt
-ed (gofumpt)
numForcedGCMetricsDescription = "The number of GC cycles called by the application" | ||
|
||
heapWillReturnMetricsName = "heap_will_return_bytes" | ||
heapWillReturnMetricsDescription = "Bytes of returning to OS. It contains the two following parts (heapWillReturn = heapIdle - heapReleased)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
G101: Potential hardcoded credentials (gosec)
case strings.HasPrefix(line, "VmPeak"): | ||
f, err := strconv.ParseInt(fields[1], 10, 64) | ||
if err == nil { | ||
vmpeak.Observe(ctx, f*1024) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
mnd: Magic number: 1024, in detected (gomnd)
case strings.HasPrefix(line, "VmSize"): | ||
f, err := strconv.ParseInt(fields[1], 10, 64) | ||
if err == nil { | ||
vmsize.Observe(ctx, f*1024) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
mnd: Magic number: 1024, in detected (gomnd)
case strings.HasPrefix(line, "VmHWM"): | ||
f, err := strconv.ParseInt(fields[1], 10, 64) | ||
if err == nil { | ||
vmhwm.Observe(ctx, f*1024) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
mnd: Magic number: 1024, in detected (gomnd)
@@ -246,6 +415,12 @@ | |||
return err | |||
} | |||
|
|||
looksup, err := m.AsyncInt64().Gauge( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
ineffectual assignment to err (ineffassign)
}, nil | ||
} | ||
|
||
func (p *procStatusMetrics) Register(m metrics.Meter) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
Function name: Register, Cyclomatic Complexity: 39, Halstead Volume: 4841.03, Maintainability Index: 18 (maintidx)
case strings.HasPrefix(line, "VmPeak"): | ||
f, err := strconv.ParseInt(fields[1], 10, 64) | ||
if err == nil { | ||
vmpeak.Observe(ctx, f*1024) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
mnd: Magic number: 1024, in detected (gomnd)
case strings.HasPrefix(line, "VmSize"): | ||
f, err := strconv.ParseInt(fields[1], 10, 64) | ||
if err == nil { | ||
vmsize.Observe(ctx, f*1024) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
mnd: Magic number: 1024, in detected (gomnd)
case strings.HasPrefix(line, "VmHWM"): | ||
f, err := strconv.ParseInt(fields[1], 10, 64) | ||
if err == nil { | ||
vmhwm.Observe(ctx, f*1024) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
mnd: Magic number: 1024, in detected (gomnd)
}, nil | ||
} | ||
|
||
func (p *procStatusMetrics) Register(m metrics.Meter) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
Function name: Register, Cyclomatic Complexity: 39, Halstead Volume: 4841.03, Maintainability Index: 18 (maintidx)
Signed-off-by: Kosuke Morimoto <[email protected]>
Signed-off-by: Kosuke Morimoto <[email protected]>
Signed-off-by: Kosuke Morimoto <[email protected]>
Signed-off-by: Kosuke Morimoto <[email protected]>
Signed-off-by: Kosuke Morimoto <[email protected]>
Signed-off-by: Kosuke Morimoto <[email protected]>
Signed-off-by: Kosuke Morimoto <[email protected]>
Signed-off-by: Kosuke Morimoto <[email protected]>
Signed-off-by: Kosuke Morimoto <[email protected]>
Signed-off-by: Kosuke Morimoto <[email protected]>
Signed-off-by: Kosuke Morimoto <[email protected]>
Signed-off-by: Kosuke Morimoto <[email protected]>
bf35601
to
7b2460b
Compare
Signed-off-by: Kosuke Morimoto <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!!
Description:
internal/observability/metrics/mem
package has implementation of metricsRelated Issue:
NONE
Versions:
Checklist:
Special notes for your reviewer: