Skip to content

Commit

Permalink
Aedara/appeals 23485 (#18809)
Browse files Browse the repository at this point in the history
* Update PdfPage.jsx

* Update Metrics.js

* Update PdfPage.jsx
  • Loading branch information
AnandEdara authored Jun 21, 2023
1 parent bd5f764 commit c036bbc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
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
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

0 comments on commit c036bbc

Please sign in to comment.