Added tracking loading time

This commit is contained in:
Donald Cheng Hong Zou 2022-01-19 10:43:39 -05:00
parent fcfd816cec
commit ed2c3f43c7
2 changed files with 8 additions and 2 deletions

View file

@ -338,9 +338,12 @@
* Load Peers from server to configuration page
* @param searchString
*/
let d1 = new Date();
let time = 0;
let count = 0;
function loadPeers(searchString){
startProgressBar();
let d1 = new Date();
d1 = new Date();
$.ajax({
method: "GET",
url: `/get_config/${conf_name}?search=${encodeURIComponent(searchString)}`,
@ -357,6 +360,9 @@
endProgressBar();
let d2 = new Date();
let seconds = (d2 - d1);
time += seconds;
count += 1;
console.log(`Average ${time/count}ms`);
$("#peer_loading_time").html(`Peer Loading Time: ${seconds}ms`);
}).fail(function(){
noResponding();

File diff suppressed because one or more lines are too long