Skip to content
This repository has been archived by the owner on Jul 19, 2023. It is now read-only.

Order stacktraces by ID to have a deterministic flamegraph #119

Merged
merged 2 commits into from
Jul 26, 2022

Conversation

simonswine
Copy link
Collaborator

@simonswine simonswine commented Jul 26, 2022

This orders the stacktraces based on the ID. This allows to output a deterministic flamegraph.

(It is worth trying to watch explore with an auto-refresh, then you can see the individual parts of it growing)

I don't think this should be optional. I have not checked it's impact, but that's probably the best position to order, as we already have the stacktrace ID.

Fixes #111

@simonswine simonswine marked this pull request as ready for review July 26, 2022 08:19
result := make([]stacktraces, 0, len(stacktracesByID))
for _, stacktrace := range stacktracesByID {
result = append(result, *stacktrace)
ids := make([]uint64, 0, len(stacktracesByID))
Copy link
Collaborator

Choose a reason for hiding this comment

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

ids := lo.Keys(stacktracesByID)

Copy link
Collaborator

@cyriltovena cyriltovena left a comment

Choose a reason for hiding this comment

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

LGTM

@simonswine simonswine merged commit f0da231 into main Jul 26, 2022
@simonswine simonswine deleted the 20220726_make-order-of-stacktraces-stable branch July 26, 2022 08:56
simonswine added a commit to simonswine/pyroscope that referenced this pull request Jun 30, 2023
…r-of-stacktraces-stable

Order stacktraces by ID to have a deterministic flamegraph
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flamegraph rendering should be deterministic
2 participants