mirror of https://github.com/statping/statping
Merge branch 'master' into feature/tls-renegotiation
commit
6b74003533
|
@ -96,21 +96,17 @@
|
|||
start = new Date(start.getUTCFullYear(), start.getUTCMonth()+1, 1);
|
||||
monthNum += 1
|
||||
}
|
||||
|
||||
window.console.log(monthData)
|
||||
this.series = monthData.reverse()
|
||||
this.ready = true
|
||||
},
|
||||
async heatmapData(start, end) {
|
||||
|
||||
window.console.log("start: ", start)
|
||||
window.console.log("end: ", end)
|
||||
|
||||
const data = await Api.service_failures_data(this.service.id, this.toUnix(start), this.toUnix(end), "24h", true)
|
||||
|
||||
let dataArr = []
|
||||
if (!data) {
|
||||
return {name: start.toLocaleString('en-us', { month: 'long'}), data: []}
|
||||
}
|
||||
data.forEach((d) => {
|
||||
dataArr.push({x: this.parseISO(d.timeframe), y: d.amount});
|
||||
dataArr.push({x: this.parseISO(d.timeframe), y: d.amount});
|
||||
});
|
||||
|
||||
let date = new Date(dataArr[0].x);
|
||||
|
|
|
@ -44,23 +44,25 @@
|
|||
async mounted() {
|
||||
await this.latencyYesterday();
|
||||
},
|
||||
async latencyYesterday() {
|
||||
const todayTime = await Api.service_hits(this.service.id, this.toUnix(this.nowSubtract(86400)), this.toUnix(new Date()), this.group, false)
|
||||
const fetched = await Api.service_hits(this.service.id, this.start, this.end, this.group, false)
|
||||
methods: {
|
||||
async latencyYesterday() {
|
||||
const todayTime = await Api.service_hits(this.service.id, this.toUnix(this.nowSubtract(86400)), this.toUnix(new Date()), this.group, false)
|
||||
const fetched = await Api.service_hits(this.service.id, this.start, this.end, this.group, false)
|
||||
|
||||
let todayAmount = this.addAmounts(todayTime)
|
||||
let yesterday = this.addAmounts(fetched)
|
||||
let todayAmount = this.addAmounts(todayTime)
|
||||
let yesterday = this.addAmounts(fetched)
|
||||
|
||||
window.console.log(todayAmount)
|
||||
window.console.log(yesterday)
|
||||
window.console.log(todayAmount)
|
||||
window.console.log(yesterday)
|
||||
|
||||
},
|
||||
addAmounts(data) {
|
||||
let total = 0
|
||||
data.forEach((f) => {
|
||||
total += parseInt(f.amount)
|
||||
});
|
||||
return total
|
||||
},
|
||||
addAmounts(data) {
|
||||
let total = 0
|
||||
data.forEach((f) => {
|
||||
total += parseInt(f.amount)
|
||||
});
|
||||
return total
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue