分开上下行统计

This commit is contained in:
CN-JS-HuiBai
2026-04-05 18:06:11 +08:00
parent 9e827c9831
commit aed9147074
4 changed files with 34 additions and 12 deletions

View File

@@ -49,9 +49,8 @@ class AreaChart {
}
// Calculate P95 (95th percentile)
// Common standard: 95th percentile of the peak (max of rx/tx or sum)
// We'll use max(rx, tx) at each point which is common for billing
const combined = data.rx.map((r, i) => Math.max(r || 0, data.tx[i] || 0));
// Updated: Only count Upstream (TX) as requested
const combined = data.tx.map(t => t || 0);
if (combined.length > 0) {
const sorted = [...combined].sort((a, b) => a - b);
const p95Idx = Math.floor(sorted.length * 0.95);