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

Trace viewer precision #7

Closed
danstarns opened this issue Sep 3, 2023 · 3 comments · Fixed by #22
Closed

Trace viewer precision #7

danstarns opened this issue Sep 3, 2023 · 3 comments · Fixed by #22
Assignees

Comments

@danstarns
Copy link
Member

danstarns commented Sep 3, 2023

Problem

The trace viewer doesn't accurately display the whole trace, see in the screenshot how we are only plotting spans in MS and not accounting for those spans that are of a lesser value.

Screenshot 2023-09-03 at 11 09 41

Due to the fact, we dont account for spans that are of a smaller value than an MS, the width and offset of each trace in the viewer is skewed.

@Tohaker
Copy link
Collaborator

Tohaker commented Sep 8, 2023

Trying out a few things, got it displaying the right units at least, depending on how big the durationNano value is
image

Figuring out the width and making the logic reusable will be the next steps

@Tohaker
Copy link
Collaborator

Tohaker commented Sep 9, 2023

image

Played around with some BigInt maths, the existing logic appears overly complicated since it was trying to contextualise everything into ms whereas all we needed was a percentage of the total time span. Resolution was also being lost when casting to Number so that's been saved for the last step of the calculations

@Tohaker
Copy link
Collaborator

Tohaker commented Sep 9, 2023

Finally, some proper precision in calculating the time;

image

I've placed the logic from the Span component into the unix-nano module so it's all contained in one place, and got some janky BigInt maths holding it all together. I suppose as we're targeting developers machines, browser support isn't top priority and most of this stuff is supported by recent versions of all major browsers so users shouldn't have too hard a time running it

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

Successfully merging a pull request may close this issue.

2 participants