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

Aedara/appeals 23485 #18809

Merged
merged 4 commits into from
Jun 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion client/app/reader/PdfPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,10 @@ export class PdfPage extends React.PureComponent {
value: this.measureTimeStartMs ? performance.now() - this.measureTimeStartMs : 0,
appName: 'Reader',
attrs: {
documentId: this.props.documentId,
overscan: this.props.windowingOverscan,
documentType: this.props.documentType,
pageCount: this.props.pdfDocument.pdfInfo?.numPages
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this not populating?

pageCount: this.props.pdfDocument.numPages
}
});
});
Expand Down
19 changes: 19 additions & 0 deletions client/app/util/Metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,25 @@ export const collectHistogram = (data) => {
initialize();

histograms.push(ApiUtil.convertToSnakeCase(data));

const id = uuid.v4();
const metricsData = data;
const time = Date(Date.now()).toString();
const readerData = {
message: 'Render document content for "' + data.attrs.documentType + '"',
type: 'performance',
product: 'pdfjs.document.render',
start:time,
end: Date(Date.now()).toString(),
duration: data.value,
}

if(data.value > 0){
storeMetrics(id,metricsData,readerData);
}
else if(data.attrs.pageCount < 2){
storeMetrics(id,metricsData,readerData);
}
};

// ------------------------------------------------------------------------------------------
Expand Down