From cf2408013e86c0369afc606456f7f2199e0dd58c Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Fri, 23 Dec 2022 10:54:40 +0530 Subject: [PATCH] Measure the click-to-render-request latency, only if the click button was used --- ui/media/js/engine.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/media/js/engine.js b/ui/media/js/engine.js index 95725dfc..467a45c5 100644 --- a/ui/media/js/engine.js +++ b/ui/media/js/engine.js @@ -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)