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

include timestamp in samples returned by MultiProcessCollector._accumulate_metrics #1057

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

roganartu
Copy link

Fixes #1056

@roganartu roganartu force-pushed the multiprocess-timestamp-fix branch from ea68bfe to 61e4a03 Compare August 19, 2024 14:42
@roganartu roganartu force-pushed the multiprocess-timestamp-fix branch from 61e4a03 to f14021f Compare August 19, 2024 14:45
Copy link
Member

@csmarchbanks csmarchbanks left a comment

Choose a reason for hiding this comment

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

One tiny ask, but generally 👍! Is it also possible to write a test for this behavior to avoid any regressions?

@@ -92,10 +92,11 @@ def _accumulate_metrics(metrics, accumulate):
sample_timestamps = defaultdict(float)
buckets = defaultdict(lambda: defaultdict(float))
samples_setdefault = samples.setdefault
generate_pidless_key = lambda x, y: (x, tuple(l for l in y if l[0] != 'pid'))
Copy link
Member

Choose a reason for hiding this comment

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

Rather than x, y can we keep name, labels so we know what each variable is? It would also be fine to move this to a real func instead of a lambda if there are more name conflicts.

Copy link
Member

Choose a reason for hiding this comment

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

Just a quick bump on this request, otherwise good to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MultiProcessCollector._accumulate_metrics always drops timestamps
2 participants