8000 [BUGFIX] TracingGanttChart: calculate start and end time from all spans by andreasgerstmayr · Pull Request #2351 · perses/perses · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[BUGFIX] TracingGanttChart: calculate start and end time from all spans #2351

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

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

andreasgerstmayr
Copy link
Contributor

Description

In some cases, the trace start and end time does not match the start and end time of the root span (in other words, some spans are in progress or started after the root span has ended).

  • compute and memoize start and end time of the trace by scanning all spans of the trace
  • introduce a GanttTrace data type which holds these pre-computed fields
  • update all React props rootSpan --> trace and all references rootSpan.startTimeUnixMs --> trace.startTimeUnixMs (and .endTime)

Screenshots

The trace contains spans starting after the root span has ended:
image

Checklist

  • Pull request has a descriptive title and context useful to a reviewer.
  • Pull request title follows the [<catalog_entry>] <commit message> naming convention using one of the
    following catalog_entry values: FEATURE, ENHANCEMENT, BUGFIX, BREAKINGCHANGE, DOC,IGNORE.
  • All commits have DCO signoffs.

UI Changes

  • Changes that impact the UI include screenshots and/or screencasts of the relevant changes.
  • Code follows the UI guidelines.
  • Visual tests are stable and unlikely to be flaky.
    See Storybook
    and e2e docs for more details. Common issues
    include:
    • Is the data inconsistent? You need to mock API requests.
    • Does the time change? You need to use consistent time values or mock time utilities.
    • Does it have loading states? You need to wait for loading to complete.

Copy link
Member
@celian-garcia celian-garcia left a comment

Choose a reason for hiding this comment

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

Just a nit.
Apart from that I went through the files and didn' t see anything shocking.

I was wondering if it couldn' t be considered as a breaking change to modify the TracingGanttChart component interface but I guess one should use the TracingGanttCharPanel component right? On which the interface didn' t change.

And by the way that' s cool as I think we have some slight time issues with our spans and sometimes they are no completely aligned. I guess it will fix som display for us as well.

@andreasgerstmayr
Copy link
Contributor Author

I was wondering if it couldn' t be considered as a breaking change to modify the TracingGanttChart component interface but I guess one should use the TracingGanttCharPanel component right? On which the interface didn' t change.

Yes, TracingGanttChart.PanelComponent should be used.
In the index.ts file we only export types from TracingGanttChart.ts, so I'd consider everything which is not exported as an internal implementation detail.

And by the way that' s cool as I think we have some slight time issues with our spans and sometimes they are no completely aligned. I guess it will fix som display for us as well.

👍 let me know if you find other issues :)

Copy link
Member
@celian-garcia celian-garcia left a comment

Choose a reason for hiding this comment

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

This freaking DCO on suggestion.. Sorry you'll have to fix it manually I believe...
Otherwise LGTM

In some cases, the trace start and end time does not match the start and
end time of the root span (in other words, some spans are in progress or
started after the root span has ended).

* compute and memoize start and end time of the trace by scanning all
  spans of the trace
* introduce a GanttTrace data type which holds these pre-computed fields
* update all React props `rootSpan` --> `trace` and all references
  `rootSpan.startTimeUnixMs` --> `trace.startTimeUnixMs` (and `.endTime`)

Signed-off-by: Andreas Gerstmayr <agerstmayr@redhat.com>
@andreasgerstmayr andreasgerstmayr added this pull request to the merge queue Oct 21, 2024
Merged via the queue into perses:main with commit 575680b Oct 21, 2024
18 checks passed
@andreasgerstmayr andreasgerstmayr deleted the gantt-chart-startend branch October 21, 2024 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
5C8E
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0