-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Support memory profiling metrics #4239
Conversation
Codecov Report
|
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.
Looks great, just a couple of questions!
__slots__ = ('name', 'value') | ||
|
||
def __init__(self, name, value): | ||
self.name = 'datadog.agent.profile.memory.{}'.format(name) |
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.
perhaps we could put the datadog.agent.profile.memory
namespace in a global, or at least datadog.agent.profile
so we can reuse when/if the cpu
profiling metrics come along?
@@ -121,9 +129,11 @@ def write_pretty_top(path, snapshot, unit_formatter, key_type, limit, cumulative | |||
amount, unit = unit_formatter(total) | |||
f.write('Total allocated size: {} {}\n'.format(amount, unit)) | |||
|
|||
metrics.append(MemoryProfileMetric('check_run_total', total)) |
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.
maybe check_run_alloc
? I feel like total might mislead to think it's the entire memory being used by the check, where that wouldn't be entirely accurate.
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.
🚀
Additional Notes
The first metric is
datadog.agent.profile.memory.check_run_alloc
tagged by check name and version