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

Lens editor performance metrics #163002

Conversation

drewdaemon
Copy link
Contributor

Summary

Four metrics

  • XY visualization registration time
  • main chart
    • time to load data
    • time to render
  • time to load and render all suggestions

if (renderDeps.current) {
console.log(
'visualization took to render after data received',
Copy link
Contributor Author

@drewdaemon drewdaemon Aug 2, 2023

Choose a reason for hiding this comment

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

Time to render after data received

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one won't be accurate until we have a solution to elastic/elastic-charts#2124

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if (renderDeps.current) {
dataReceivedTime.current = performance.now();
console.log('data took to arrive', dataReceivedTime.current - initialRenderTime.current);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Time data took to arrive

@@ -693,6 +697,12 @@ export const VisualizationWrapper = ({
// Used for reporting
const { isRenderComplete, hasDynamicError, setIsRenderComplete, setDynamicError, nodeRef } =
useReportingState(errors);

const onRenderHandler = useCallback(() => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

important to memoize since the inline version was causing multiple subscriptions to be created in the expression renderer

Comment on lines +537 to +541
{changesApplied
? activeData
? renderSuggestionsUI()
: renderSuggestionsLoadingState()
: renderApplyChangesPrompt()}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wait for active data before starting suggestion render. Otherwise, initial suggestion render is interrupted by a re-render when active data arrives, making it difficult to actually track when the suggestions are finished.

There are other ways we could approach this if we don't like this one.

const onSuggestionRender = useCallback(() => {
suggestionsRendered.current++;
if (suggestionsRendered.current === totalSuggestions) {
console.log('suggestions finished rendering', performance.now() - startTime.current);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All suggestions have rendered...

@drewdaemon drewdaemon marked this pull request as ready for review August 2, 2023 16:49
@drewdaemon drewdaemon requested review from a team as code owners August 2, 2023 16:49
@kibana-ci
Copy link
Collaborator

kibana-ci commented Aug 3, 2023

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #43 / Agents fleet_uploads should get agent uploads
  • [job] [logs] FTR Configs #43 / Agents fleet_uploads should get agent uploads
  • [job] [logs] Jest Tests #1 / editor_frame suggestions should display top 5 suggestions in descending order
  • [job] [logs] Jest Tests #1 / editor_frame suggestions should switch to suggested visualization
  • [job] [logs] FTR Configs #44 / Fleet Endpoints fleet policy secrets Should correctly create the policy with secrets
  • [job] [logs] FTR Configs #44 / Fleet Endpoints fleet policy secrets Should correctly create the policy with secrets
  • [job] [logs] Jest Tests #1 / suggestion_panel should dispatch visualization switch action if suggestion is clicked
  • [job] [logs] Jest Tests #1 / suggestion_panel should display apply-changes prompt when changes not applied
  • [job] [logs] Jest Tests #1 / suggestion_panel should list passed in suggestions
  • [job] [logs] Jest Tests #1 / suggestion_panel should render preview expression if there is one
  • [job] [logs] Jest Tests #1 / suggestion_panel should render render icon if there is no preview expression
  • [job] [logs] Jest Tests #1 / suggestion_panel uncommitted suggestions should highlight currently active suggestion
  • [job] [logs] Jest Tests #1 / suggestion_panel uncommitted suggestions should rollback suggestion if current panel is clicked

Metrics [docs]

‼️ ERROR: no builds found for mergeBase sha [826ec6e]

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@drewdaemon drewdaemon closed this Aug 3, 2023
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.

None yet

3 participants