Fix time conversion in overview and charts

pull/645/head
Patrick Fruh 2020-06-09 18:50:59 +02:00
parent 60100461c9
commit 811236f8b4
4 changed files with 9 additions and 9 deletions

View File

@ -131,9 +131,9 @@
const dt = new Date(ts).toLocaleDateString("en-us", timeoptions)
let val = series[seriesIndex][dataPointIndex];
if (val >= 1000) {
val = (val * 0.1).toFixed(0) + " milliseconds"
val = (val / 1000).toFixed(0) + " milliseconds"
} else {
val = (val * 0.01).toFixed(0) + " microseconds"
val = (val).toFixed(0) + " microseconds"
}
return `<div class="chartmarker"><span>Response Time: </span><span class="font-3">${val}</span><span>${dt}</span></div>`
},

View File

@ -56,9 +56,9 @@
const dt = new Date(ts).toLocaleDateString("en-us", timeoptions)
let val = series[seriesIndex][dataPointIndex];
if (val >= 1000) {
val = (val * 0.1).toFixed(0) + " milliseconds"
val = (val / 1000).toFixed(0) + " milliseconds"
} else {
val = (val * 0.01).toFixed(0) + " microseconds"
val = (val).toFixed(0) + " microseconds"
}
return `<div class="chartmarker"><span>Average Response Time: </span><span class="font-3">${val}</span><span>${dt}</span></div>`
},

View File

@ -166,10 +166,10 @@ export default Vue.mixin({
return {data: newSet}
},
humanTime(val) {
if (val >= 10000) {
return Math.floor(val / 10000) + "ms"
if (val >= 1000) {
return Math.floor(val / 1000) + "ms"
}
return Math.floor(val / 1000) + "μs"
return Math.floor(val) + "μs"
},
firstDayOfMonth(date) {
return startOfMonth(date)

View File

@ -270,9 +270,9 @@ export default {
const dt = new Date(ts).toLocaleDateString("en-us", timeoptions)
let val = series[seriesIndex][dataPointIndex];
if (val >= 1000) {
val = (val * 0.1).toFixed(0) + " milliseconds"
val = (val / 1000).toFixed(0) + " milliseconds"
} else {
val = (val * 0.01).toFixed(0) + " microseconds"
val = (val).toFixed(0) + " microseconds"
}
return `<div class="chartmarker"><span>Response Time: </span><span class="font-3">${val}</span><span>${dt}</span></div>`
},