-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
status: export metrics about MemStats into timeseries #119819
Conversation
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? Thank you for contributing to CockroachDB. Please ensure you have followed the guidelines for creating a PR. Before a member of our team reviews your PR, I have some potential action items for you:
I have added a few people who may be able to assist in reviewing: 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
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.
Reviewed all commit messages.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @1lann, @lyang24, and @xinhaoz)
pkg/server/status/runtime.go
line 160 at r1 (raw file):
Unit: metric.Unit_BYTES, } metaMemStackSysBytes = metric.Metadata{
These metrics are all coming from the go runtime. Let's make the following changes:
- move them up below
metaGoTotalBytes
- rename them to start with
metaGo
- rename the metrics to start with
sys.go.
- rename the gauges to start with
Go
- move the corresponding
metric.Gauge
s up belowGoTotalBytes
. - move the corresponding
metric.Gauge
construction in upNewRuntimeStatSampler
up belowGoTotalBytes: ...
. - move the corresponding
metric.Gauge.Update
calls up
pkg/server/status/runtime.go
line 184 at r1 (raw file):
Unit: metric.Unit_BYTES, } metaTotalAlloc = metric.Metadata{
metaGoTotalAllocBytes
Same thing with the gauge, TotalAllocBytes
.
pkg/server/status/runtime.go
line 371 at r1 (raw file):
// Stack memory allocated by the underlying operating system. // In non-cgo programs this metric is currently zero. This may // change in the future.In cgo programs this metric includes
nit: missing space after future.
pkg/server/status/runtime.go
line 874 at r1 (raw file):
rsr.TotalMemBytes.Update(totalMem) rsr.MemStackSysBytes.Update(int64(osStackBytes)) rsr.HeapFragmentBytes.Update(int64(rsr.goRuntimeSampler.uint64(runtimeMetricHeapFragmentBytes)))
We're already fetching these first three from the goRuntimeSampler
above. Should we pull them out into variables?
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
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.
Thank you for review, I have addressed the comments please take another look.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @1lann and @xinhaoz)
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
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.
once the remaining comments are resolved.
Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @1lann, @lyang24, and @xinhaoz)
pkg/server/status/runtime.go
line 184 at r1 (raw file):
Previously, nvanbenschoten (Nathan VanBenschoten) wrote…
metaGoTotalAllocBytes
Same thing with the gauge,
TotalAllocBytes
.
Looks like this comment was missed.
pkg/server/status/runtime.go
line 69 at r2 (raw file):
metaGoMemStackSysBytes = metric.Metadata{ Name: "sys.go.stack.systembytes", Help: "Stack memories obtained from the OS.",
s/memories/memory/
pkg/server/status/runtime.go
line 75 at r2 (raw file):
metaGoHeapFragmentBytes = metric.Metadata{ Name: "sys.go.heap.heapfragmentbytes", Help: "Total heap fragmentation bytes, derived from bytes in in-use spans subtracts bytes allocated",
s/subtracts/minus/g
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
This commit exposes 5 metrics into cockroachdb's RuntimeStatSampler timeseries. The added metrics are MemStackSysBytes, HeapFragmentBytes, HeapReservedBytes, HeapReleasedBytes, TotalAlloc. These metrics are derived from rumtime/metrics. Fixes: cockroachdb#96717 Relase note: None
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
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.
Appreciated the reviews!
Reviewable status: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @1lann, @nvanbenschoten, and @xinhaoz)
pkg/server/status/runtime.go
line 184 at r1 (raw file):
Previously, nvanbenschoten (Nathan VanBenschoten) wrote…
Looks like this comment was missed.
indeed thanks for catching
bors r+ |
Build succeeded: |
This commit exposes 5 metrics into cockroachdb's RuntimeStatSampler timeseries. The added metrics are MemStackSysBytes, HeapFragmentBytes, HeapReservedBytes, HeapReleasedBytes, TotalAlloc. These metrics are derived from rumtime/metrics.
Fixes: #96717
Relase note: None