-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Lens editor performance metrics #163002
Conversation
if (renderDeps.current) { | ||
console.log( | ||
'visualization took to render after data received', |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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(() => { |
There was a problem hiding this comment.
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
{changesApplied | ||
? activeData | ||
? renderSuggestionsUI() | ||
: renderSuggestionsLoadingState() | ||
: renderApplyChangesPrompt()} |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All suggestions have rendered...
💔 Build FailedFailed CI Steps
Test Failures
Metrics [docs]
History
To update your PR or re-run it, just comment with: |
Summary
Four metrics