Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(apps/metrics/prometheus): 修复统计报表请求数为负数问题 #1125

Merged
merged 2 commits into from
Nov 25, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(apps/metrics/prometheus): 修复统计报表请求负数问题
F-cq committed Nov 21, 2024
commit d22a04ff1cd541cc7d9aa4db0884b9385348a9c9
Original file line number Diff line number Diff line change
@@ -124,7 +124,7 @@ def get_data_differ_number(data: dict) -> int:
last_number = datapoints[-2][0] if last_value is None else last_value

# 返回计算的差值,并确保结果是整数
return int(last_number) - int(first_number)
return abs(int(last_number) - int(first_number))

# 如果没有有效数据,返回0
return 0