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

Support memory profiling metrics #4239

Merged
merged 2 commits into from
Jul 30, 2019
Merged

Support memory profiling metrics #4239

merged 2 commits into from
Jul 30, 2019

Conversation

ofek
Copy link
Contributor

@ofek ofek commented Jul 30, 2019

Additional Notes

The first metric is datadog.agent.profile.memory.check_run_alloc tagged by check name and version

therve
therve previously approved these changes Jul 30, 2019
Copy link
Member

@truthbk truthbk left a 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)
Copy link
Member

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))
Copy link
Member

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.

Copy link
Member

@truthbk truthbk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@ofek ofek merged commit 69aa883 into master Jul 30, 2019
@ofek ofek deleted the ofek/m branch July 30, 2019 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants