add duration to heartbeat, add timezone array

This commit is contained in:
LouisLam
2021-07-01 02:02:54 +08:00
parent 46f07fc17e
commit 82afddcfd6
5 changed files with 394 additions and 4 deletions

View File

@@ -44,6 +44,14 @@ class Monitor extends BeanModel {
bean.time = R.isoDateTime(dayjs.utc());
bean.status = 0;
// Duration
if (previousBeat) {
bean.duration = dayjs(bean.time).diff(dayjs(previousBeat.time), 'second');
} else {
bean.duration = 0;
console.log(previousBeat)
}
try {
if (this.type === "http") {
let startTime = dayjs().valueOf();