mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-01 14:46:36 +08:00
fix(rate-limits): RPS 纵轴按峰值 1.5 倍动态缩放
请求压力图不再使用固定美化刻度上限,改为当前时段最高 RPS × 1.5,低流量更易读、高峰不易裁切。
This commit is contained in:
@@ -95,7 +95,13 @@ export function RatePressureChart({ data, hours }: RatePressureChartProps) {
|
||||
}, [bucketSeconds, data?.trends.requests, data?.trends.visits, hours]);
|
||||
|
||||
const option = useMemo<EChartsOption>(() => {
|
||||
const rpsMax = calculateNiceAxisMax(chartModel.rpsValues);
|
||||
const rpsPeak = Math.max(
|
||||
0,
|
||||
...chartModel.rpsValues.map((value) =>
|
||||
Number.isFinite(value) && value > 0 ? value : 0,
|
||||
),
|
||||
);
|
||||
const rpsMax = rpsPeak > 0 ? rpsPeak * 1.5 : 1;
|
||||
const visitMax = calculateNiceAxisMax(chartModel.visitValues);
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user