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 all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ 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)
total = int(last_number) - int(first_number)
return 0 if total < 0 else total

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