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

fix(GitHub Integration): Correctly extract the start/end timestamps from time picker #15

Merged
merged 13 commits into from
Jul 3, 2024

Conversation

bryanhuhta
Copy link
Contributor

@bryanhuhta bryanhuhta commented Jul 1, 2024

✨ Description

Since #5, we stopped collecting the start and end values from the url state correctly. This meant we passed empty start and end values to the backend when calling SelectMergeProfile to get a profile for a time range and stack trace. In turn, the backend would pass back an empty response because the time range (0 to 0) didn't match any blocks.

📖 Summary of the changes

This PR fixes how the UI sets the start and end when making SelectMergeProfile requests. It also fixes a rendering but where the flame graph scene would continuously re-render. It also correctly sets keepCookies in the sample provisioned data sources.

🧪 How to test?

Run locally

…ame graph container

For reasons I don't understand, doing this trick to switch the flame graph
container mode results in the component continuously rerendering. Aside from
obvious performance problems, this component with also trigger network calls
when rerendering, resulting in its contents becoming basically useless.
@bryanhuhta bryanhuhta self-assigned this Jul 1, 2024
Copy link
Contributor

github-actions bot commented Jul 1, 2024

Unit test coverage

Lines Statements Branches Functions
Coverage: 12%
12.45% (446/3582) 10.06% (134/1331) 9.47% (102/1077)

Copy link
Member

@petethepig petethepig left a comment

Choose a reason for hiding this comment

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

LGTM

@bryanhuhta bryanhuhta changed the title fix(GitHub Integration): Correctly extract the start/end timestamps from url fix(GitHub Integration): Correctly extract the start/end timestamps from time picker Jul 3, 2024
@bryanhuhta bryanhuhta merged commit fe8d807 into main Jul 3, 2024
5 checks passed
@bryanhuhta bryanhuhta deleted the gh-explore-profiles branch July 3, 2024 19:24
timelineAndProfileApiClient.setLastTimeRange(globalTimeRangeState.state.value);
}

const timeRangeSubscription = globalTimeRangeState?.subscribeToState((newState) => {
Copy link
Contributor

@grafakus grafakus Jul 10, 2024

Choose a reason for hiding this comment

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

I'm afraid this will not work as expected. E.g. switching from cpu to goroutine will not update the timerange.
The correct solution is to listen to data loading changes:

const data = buildTimeSeriesQueryRunner({});

...

data.subscribeToState((newState) => {
  if (newState.data.state === LoadingState.Loading) {
    /// capture time range
  }
});

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.

3 participants