Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
axios.get("metrics").then(res => {
this.line.xAxis[0].data.push(new Date().toLocaleTimeString()); //时间戳
this.line.series[0].data.push(res["cpu.usage"]);
this.line.series[1].data.push(res["jvm.usage"]);
this.line.series[2].data.push(res["mem.user.percent"]);
this.line.series[3].data.push(res["swap.usage"]);
this.line.series[4].data.push(0);
this.line.series[5].data.push(0);
this.line.series[6].data.push(0);
this.gauge.series[0].data[0].value = (res["cpu.usage"] || 0).toFixed(2);
this.gauge.series[1].data[0].value = (1024 / 1024).toFixed(2);
this.gauge.series[2].data[0].value = (res["jvm.usage"] || 0).toFixed(2);
this.gauge.series[3].data[0].value = (res["mem.user.percent"] || 0
).toFixed(2);
});
}, 3000);
axios.get("metrics").then(res => {
this.line.xAxis[0].data.push(new Date().toLocaleTimeString()); //时间戳
this.line.series[0].data.push(res["cpu.usage"]);
this.line.series[1].data.push(res["jvm.usage"]);
this.line.series[2].data.push(res["mem.user.percent"]);
this.line.series[3].data.push(res["swap.usage"]);
this.line.series[4].data.push(0);
this.line.series[5].data.push(0);
this.line.series[6].data.push(0);
this.gauge.series[0].data[0].value = (res["cpu.usage"] || 0).toFixed(2);
this.gauge.series[1].data[0].value = (1024 / 1024).toFixed(2);
this.gauge.series[2].data[0].value = (res["jvm.usage"] || 0).toFixed(2);
this.gauge.series[3].data[0].value = (res["mem.user.percent"] || 0
).toFixed(2);
});
}, 3000);