feat(obs): 去掉宿主机网卡趋势,磁盘读写改按速率展示

Agent 不再采集网卡累计字节,看板与节点网络图仅保留访问日志已提供/接收。
磁盘 IO 按小时换算为 B/s 曲线,摘要为近 24 小时平均速率,并同步 Swagger。
This commit is contained in:
ryan
2026-07-18 13:17:13 +08:00
parent 55f8c9a527
commit 26057514a1
20 changed files with 87 additions and 278 deletions
+5 -1
View File
@@ -15,7 +15,7 @@ type TrendChartSeries = {
valueFormatter?: (value: number) => string;
};
type TrendChartSummaryScope = 'last-point' | 'total';
type TrendChartSummaryScope = 'last-point' | 'total' | 'average';
type TrendChartProps = {
labels: string[];
@@ -43,6 +43,10 @@ function resolveSummaryValue(values: number[], scope: TrendChartSummaryScope) {
if (scope === 'total') {
return values.reduce((sum, value) => sum + value, 0);
}
if (scope === 'average') {
const sum = values.reduce((acc, value) => acc + value, 0);
return sum / values.length;
}
return values[values.length - 1] ?? 0;
}