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

feat(perf): Finish remaining landing v3 views #29715

Merged
merged 6 commits into from
Nov 2, 2021

Conversation

k-fish
Copy link
Member

@k-fish k-fish commented Nov 2, 2021

Summary

This adds a line chart type widget and support for different widget types on each of the views, as well as including multiple small fixes for behaviours noted as bugs. There will be another follow up PR for remaining small issues.

Other

  • Made some small ui tweaks like fixing flex boxes for the mini-list widgets.

This adds a line chart type widget and support for different widget types on each of the views, as well as including multiple small fixes for behaviours noted as bugs. There will be another follow up PR for remaining small issues.
@k-fish k-fish requested a review from Zylphrex November 2, 2021 16:05
@k-fish k-fish requested a review from a team as a code owner November 2, 2021 16:05
Comment on lines +182 to +184
if (isLineChart) {
return <LineChart height={height} series={[]} {...areaChartProps} />;
}
Copy link
Member

Choose a reason for hiding this comment

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

Can be a follow-up, but I think we typically use the TransparentLoadingMask over a chart to indicate loading states.

Copy link
Member Author

Choose a reason for hiding this comment

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

The transparent loading mask should only appear on reload state, which I'm thinking of handling in performance widget under the hood, instead of in these charts.

@@ -361,6 +362,7 @@ export const PERFORMANCE_TERMS: Record<PERFORMANCE_TERM, TermFormatter> = {
frozenFrames: () => t('The count of the number of frozen frames in the transaction.'),
mostErrors: () => t('Transactions with the most associated errors.'),
mostIssues: () => t('The most instances of an issue for a related transaction.'),
slowHTTPSpans: () => t('The transactions with the slowest spans of a certain type.'),
Copy link
Member

Choose a reason for hiding this comment

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

Should there be custom messages for each type?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep. Thanks for reminding me.

Comment on lines +61 to +69
const slowList = [
PerformanceWidgetSetting.SLOW_HTTP_OPS,
PerformanceWidgetSetting.SLOW_DB_OPS,
PerformanceWidgetSetting.SLOW_BROWSER_OPS,
PerformanceWidgetSetting.SLOW_RESOURCE_OPS,
PerformanceWidgetSetting.MOST_SLOW_FRAMES,
PerformanceWidgetSetting.MOST_FROZEN_FRAMES,
];
const isSlowestType = slowList.includes(props.chartSetting);
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Can we declare slowList as a set outside of this function

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I'm also considering splitting the file. I'm trying to think if I can simplify this memoization code or list visualizations to reduce the boilerplate between widgets first.

};
}, [
props.eventView.query,
props.fields[0],
Copy link
Member

Choose a reason for hiding this comment

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

Nit: you use props.fields[0] a lot in this function and I see that you have an assertion for props.fields being a list of a single item. Can we do something like

const field = props.fields[0];

After the assertion and use that throughout the function? It would clear up any concerns that there props.fields is a list of multiple items.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, great call. Might switch this when I normalize how widget specializations get called so it's always provided as the first field from the widget definition for all specializations.

@@ -86,7 +86,7 @@ export function TrendsWidget(props: Props) {
transform: transformTrendsDiscover,
},
};
}, [_eventView, trendChangeType]);
}, [eventView.query, eventView.fields, trendChangeType]);
Copy link
Member

Choose a reason for hiding this comment

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

I may be wrong but since eventView is derived from the location each time, wouldn't this cause useMemo to re-fire on every location change regardless if the fields changed or not?

Copy link
Member Author

Choose a reason for hiding this comment

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

I still have to write some tests to ensure memoization is working correctly, likely as part of the batch query handler PR, but I think this should be fine for now. eventView.query is a string, which can be compared as a primitive, which means it shouldn't cause it to refire if eventView is recreated, which is what was happening before (sorting the table caused widgets to reload... not ideal)

….tsx

Co-authored-by: Tony Xiao <txiao@sentry.io>
@k-fish k-fish enabled auto-merge (squash) November 2, 2021 17:07
@k-fish k-fish merged commit 0629234 into master Nov 2, 2021
@k-fish k-fish deleted the feat/perf-landing-finish-views-2 branch November 2, 2021 17:41
@github-actions github-actions bot locked and limited conversation to collaborators Nov 18, 2021
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.

2 participants