mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-28 05:46:36 +08:00
fix(rate-limits): RPS 纵轴按峰值 1.5 倍动态缩放
请求压力图不再使用固定美化刻度上限,改为当前时段最高 RPS × 1.5,低流量更易读、高峰不易裁切。
This commit is contained in:
@@ -22,6 +22,10 @@ sidebar: false
|
|||||||
|
|
||||||
## [unreleased]
|
## [unreleased]
|
||||||
|
|
||||||
|
### 改进
|
||||||
|
|
||||||
|
- 限流页请求压力图的 RPS 纵轴改为按当前时段最高值的 1.5 倍动态缩放,避免低流量时刻度过大、高流量时被裁切。
|
||||||
|
|
||||||
## [v3.4.2] - 2026-07-19
|
## [v3.4.2] - 2026-07-19
|
||||||
|
|
||||||
### 新增
|
### 新增
|
||||||
|
|||||||
@@ -95,7 +95,13 @@ export function RatePressureChart({ data, hours }: RatePressureChartProps) {
|
|||||||
}, [bucketSeconds, data?.trends.requests, data?.trends.visits, hours]);
|
}, [bucketSeconds, data?.trends.requests, data?.trends.visits, hours]);
|
||||||
|
|
||||||
const option = useMemo<EChartsOption>(() => {
|
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);
|
const visitMax = calculateNiceAxisMax(chartModel.visitValues);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user