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: Move Documents load time and emit meaningful content timestamp #1460

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ConradJChan
Copy link
Contributor

Moved the load event emitted from DocBaseViewer from pagesinit to the first pagerendered event for PDFJS.

Also modified the emitLoadMetrics() method in Preview.js to include a meaningful_content_timestamp which can be used to calculate Time to Meaningful Content (TTMC)

@ConradJChan ConradJChan requested a review from a team as a code owner July 27, 2022 23:53
this.emitLogEvent(PREVIEW_METRIC, {
encoding,
event_name: LOAD_METRIC.previewLoadEvent,
value: previewLoadTime.elapsed || 0,
[LOAD_METRIC.fileInfoTime]: infoTime.elapsed || 0,
[LOAD_METRIC.convertTime]: convertTime.elapsed || 0,
[LOAD_METRIC.downloadResponseTime]: downloadTime.elapsed || 0,
[LOAD_METRIC.contentLoadTime]: contentLoadTime.elapsed || 0,
[LOAD_METRIC.contentLoadTime]: contentLoadTimeDuration || 0,
[LOAD_METRIC.meaningfulContentTimestamp]: meaningfulContentTimestamp,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be contentLoadTimestamp to stay consistent with its other attribute? Should it default to 0, as well?

@@ -1174,11 +1172,6 @@ class DocBaseViewer extends BaseViewer {
// Broadcast that preview has 'loaded' when page structure is available
if (!this.loaded) {
this.loaded = true;
this.emit(VIEWER_EVENT.load, {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will this affect our existing metrics?

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Conrad Chan seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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