-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Perfomance] Add is_initial_load
meta
#206645
Conversation
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.
Approving from the Core POV because a Set
is better than a string[]
.
I added a comment because I'd love to understand what we're trying to track here.
...m/packages/shared/kbn-ebt-tools/src/performance_metrics/context/measure_interaction/index.ts
Outdated
Show resolved
Hide resolved
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.
Awesome! 🥇
Do we also have a way to distinguish whether the event was related to a page load via inside Kibana navigation or the initial load of Kibana?
with the current implementation we don't have a way to distinguish this. There is another EBT metric, kibana_started, which we might be able to correlate with these two events using their timestamps. However, this would require additional analysis work. |
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.
is_initial_load
changes with date change because selected time range is persisted via URL state. Also, URL could change even against UI actions which do not cause a data reload.
206645-initial-load-meta-url-issue.mov
See if extracting the plugin url or using pathname
is better suited here instead of the full url.
Thanks, I will take a look |
I discovered a bug while addressing the issue Abdul mentioned. The initial marker isn't removed when the page is refreshed, causing it to report an incorrect duration. |
Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services) |
Since I found the bug, I refactored and updated the code. I'm requesting another review. 🙏 |
@elasticmachine merge upstream |
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.
LGTM (code review only)
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.
performance.clearMarks(perfomanceMarkers.endPageReady); | ||
} | ||
|
||
if ( |
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.
Just curious, is there a scenario in which the onPageReady
is called, but none of these two conditions are called?
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.
You mean startPageRefresh
?
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.
No, I mean the onPageReady
function, which has this logic; suppose that it is called, but none of these two conditions are met. Is it possible?
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.
I don't think it's possible. At least the first statement will always be true at least once. In the initial load.
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.
When checking locally, I found that for Metrics Explorer, the refresh duration is very low (it seems it's instantaneous) and doesn't account for the network request time.
The initial load duration looks fine.
206645-Refresh-Duration-Very-Low.mov
* The marker set by this function can later be used in performance measurements | ||
* along with an end marker end::pageReady to determine the total refresh duration. | ||
*/ | ||
markPerformanceRefreshStart(): void; |
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.
markPerformanceRefreshStart(): void; | |
onPageRefreshStart(): void; |
To be consistent with onPageReady
and to abstract the performance marking bit. Not a strong opinion though.
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.
Thanks for the suggestion. I will update
The service map tab should also report TTFMP .
|
Good catch. Fixed it here 294a3e5 |
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.
The refresh duration on Metrics Explorer is good now. But the date change is still instantaneous.
206645-Refresh-Date-Change-Issue.mov
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Async chunks
Page load bundle
History
|
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.
LGTM!
Thanks for adding the prop.
Starting backport for target branches: 9.0 https://github.com/elastic/kibana/actions/runs/13528675783 |
💔 All backports failed
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
closes https://github.com/elastic/observability-dev/issues/4185
Summary
This PR adds the
is_initial_load
parameter to the meta field to distinguish whether theonPageReady
trigger occurs during the initial load or a page refresh.Refactoring:
target
field. ascontext.pageName
now provides the necessary informationFixes:
The plugins need to call the following function:
onPageRefreshStart()
This method adds a performance marker
start::pageRefresh
to indicate when a page refresh begins. This marker is used along with an end markerend::pageReady
to determine the total refresh duration.Screen.Recording.2025-02-14.at.12.39.54.PM.mov
Screen.Recording.2025-02-14.at.12.43.29.PM.mov
How to test
yarn kbn bootstrap
TODO