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

*: Icicle charts support #5383

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open

*: Icicle charts support #5383

wants to merge 21 commits into from

Conversation

manojVivek
Copy link
Contributor

No description provided.

Copy link

alwaysmeticulous bot commented Dec 12, 2024

✅ Meticulous spotted zero visual differences across 166 screens tested: view results.

Meticulous simulated ~4 hours of user flows against your PR.

Expected differences? Click here. Last updated for commit 5924c82. This comment will update as new commits are pushed.

Copy link
Member

@brancz brancz left a comment

Choose a reason for hiding this comment

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

If I'm understanding this right, we don't yet have the ability to merge stacks that are "next to each other", correct? I'm not sure yet whether we will need to re-think whether flamegraphs and flamecharts can be rendered with the same code since one cares about order and the other doesn't.

durationStr := strconv.FormatInt(r.Duration.Value(i), 10)
_, _ = tsHasher.Write([]byte(tsStr))
_, _ = tsHasher.Write([]byte(durationStr))
tsHash = tsHasher.Sum64()
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need to do any of this hashing. Timestamp is already an int64, so just do uint64(timestamp).

tsHash = tsHasher.Sum64()

sampleTsRow := row
if row, ok := fb.rootsRow[tsHash]; ok {
Copy link
Member

Choose a reason for hiding this comment

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

for flamecharts having a root for a timestamp that already exists means we can't possibly build a correct flamechart, we should error on this case

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm sorry I don't understand why this has to be errored.

So what I'm trying to here is convert the following records

[{
    ts: timestamp-1
    samples: ....
  },
  {
    ts: timestamp-2
    samples: ....
  },
  {
    ts: timestamp-1
    samples: .....
}]

to

[{
    ts:timestamp-1
    samples: ....
  },
  {
    ts: tiemstamp-2
    samples: ....
}]

So that we'll have all samples with the same timestamp are grouped under a single root, that is easier for rendering in the UI.
Isn't this similar to the group by label here:
Screenshot 2024-12-16 at 3 03 30 PM

Copy link
Member

Choose a reason for hiding this comment

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

There can't ever be two samples at the same timestamp for the same thread or CPU. Merging should happen when end timestamp == next timestamp (within some error of margin because clocks aren't perfectly precise, maybe 1-10 ms).

Copy link
Member

Choose a reason for hiding this comment

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

And end timestamp = timestamp + value

@@ -284,6 +325,10 @@ func generateFlamegraphArrowRecord(ctx context.Context, mem memory.Allocator, tr
if fb.aggregationConfig.aggregateByLocationAddress {
key = hashCombine(key, r.Address.Value(j))
}
if fb.aggregationConfig.aggregateByTimestamp {
key = hashCombine(key, uint64(r.Timestamp.Value(i)))
key = hashCombine(key, uint64(r.Duration.Value(i)))
Copy link
Member

Choose a reason for hiding this comment

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

given the other comments, we shoudn't need the duration to be part of the hash

case profile.ColumnTimestamp:
ts := r.Timestamp.Value(sampleRow)
b.Append([]byte(fmt.Sprint(ts)))
case profile.ColumnDuration:
Copy link
Member

Choose a reason for hiding this comment

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

same (we can use value to tell us how wide the frame should be)

@manojVivek
Copy link
Contributor Author

If I'm understanding this right, we don't yet have the ability to merge stacks that are "next to each other", correct?

Yes merging of stacks is not implemented yet.

I'm not sure yet whether we will need to re-think whether flamegraphs and flamecharts can be rendered with the same code since one cares about order and the other doesn't.

This is handled in the UI where we only change the way we render the root node, so that the ordering is handled for flamecharts. Or am I missing something here? Please let me know.

@brancz
Copy link
Member

brancz commented Dec 16, 2024

Rendering is a bit overused of a term, I just meant in regards to the backend code rendering the API response. That the UI does the sorting is ok-ish for now, but I'm unsure that this will scale.

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.

2 participants