mirror of https://github.com/bastienwirtz/homer
Add a flag to hide the averages. They are not calculated in this case
parent
732f072cd4
commit
bd0a4e9cfd
|
@ -60,6 +60,7 @@ export default {
|
|||
// Initialise counts, avg times
|
||||
this.total = response.length;
|
||||
this.up = 0;
|
||||
|
||||
let totalrestime = 0;
|
||||
let totalresults = 0;
|
||||
|
||||
|
@ -68,16 +69,22 @@ export default {
|
|||
this.up++;
|
||||
};
|
||||
|
||||
// Update array of average times
|
||||
let totalduration = 0;
|
||||
let rescounter = 0;
|
||||
job.results.forEach((res) => {
|
||||
totalduration += parseInt(res.duration, 10) / 1000;
|
||||
rescounter++;
|
||||
})
|
||||
if (!this.item.hideaverages) {
|
||||
// Update array of average times
|
||||
let totalduration = 0;
|
||||
let rescounter = 0;
|
||||
job.results.forEach((res) => {
|
||||
totalduration += parseInt(res.duration, 10) / 1000;
|
||||
rescounter++;
|
||||
})
|
||||
|
||||
totalrestime += totalduration;
|
||||
totalresults += rescounter;
|
||||
} else {
|
||||
totalrestime = 0;
|
||||
totalresults = 1;
|
||||
}
|
||||
|
||||
totalrestime += totalduration;
|
||||
totalresults += rescounter;
|
||||
})
|
||||
|
||||
// Rest are down
|
||||
|
|
Loading…
Reference in New Issue