修复服务统计--流量统计--即时的tooltip错误

This commit is contained in:
刘祥超
2022-03-29 10:29:49 +08:00
parent 9d0d323b50
commit b33e9d9187

View File

@@ -2,6 +2,15 @@ Tea.context(function () {
this.$delay(function () { this.$delay(function () {
let that = this let that = this
// 每N分钟取一次
let newStats = []
for (let i = 0; i < this.minutelyStats.length; i++) {
if (i % 5 == 0) {
newStats.push(this.minutelyStats[i])
}
}
this.minutelyStats = newStats
this.reloadRequestsChart("minutely-requests-chart", "请求数统计", this.minutelyStats, function (args) { this.reloadRequestsChart("minutely-requests-chart", "请求数统计", this.minutelyStats, function (args) {
if (args.seriesIndex == 0) { if (args.seriesIndex == 0) {
return that.minutelyStats[args.dataIndex].day + " " + that.minutelyStats[args.dataIndex].minute + "<br/>请求数: " + teaweb.formatNumber(that.minutelyStats[args.dataIndex].countRequests) return that.minutelyStats[args.dataIndex].day + " " + that.minutelyStats[args.dataIndex].minute + "<br/>请求数: " + teaweb.formatNumber(that.minutelyStats[args.dataIndex].countRequests)
@@ -36,15 +45,6 @@ Tea.context(function () {
return return
} }
// 每N分钟取一次
let newStats = []
for (let i = 0; i < stats.length; i++) {
if (i % 5 == 0) {
newStats.push(stats[i])
}
}
stats = newStats
let axis = teaweb.countAxis(stats, function (v) { let axis = teaweb.countAxis(stats, function (v) {
return Math.max(v.countRequests, v.countCachedRequests) return Math.max(v.countRequests, v.countCachedRequests)
}) })
@@ -119,15 +119,6 @@ Tea.context(function () {
return return
} }
// 每N分钟取一次
let newStats = []
for (let i = 0; i < stats.length; i++) {
if (i % 5 == 0) {
newStats.push(stats[i])
}
}
stats = newStats
let axis = teaweb.bytesAxis(stats, function (v) { let axis = teaweb.bytesAxis(stats, function (v) {
return Math.max(v.bytes, v.cachedBytes) return Math.max(v.bytes, v.cachedBytes)
}) })