Measure the click-to-render-request latency, only if the click button was used

This commit is contained in:
cmdr2 2022-12-23 10:54:40 +05:30 committed by GitHub
parent 5cb24f992c
commit cf2408013e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -840,7 +840,9 @@
*/
async post(timeout=-1) {
performance.mark('make-render-request')
console.log('delay between clicking and making the server request:', performance.measure('diff', 'click-makeImage', 'make-render-request').duration + ' ms')
if (performance.getEntriesByName('click-makeImage', 'mark').length > 0) {
console.log('delay between clicking and making the server request:', performance.measure('diff', 'click-makeImage', 'make-render-request').duration + ' ms')
}
let jsonResponse = await super.post('/render', timeout)
if (typeof jsonResponse?.task !== 'number') {
console.warn('Endpoint error response: ', jsonResponse)