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: 修复错误率error_rate计算错误 #3002

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 @@ -121,8 +121,8 @@ def get_mapping(cls, metric):
total_mapping.setdefault(span, 0)
total_mapping[span] += value

error_mapping.setdefault(span, 0)
if status_code == str(StatusCode.ERROR.value):
error_mapping.setdefault(span, 0)
error_mapping[span] += value

endpoint_names.add(span)
Expand All @@ -132,7 +132,6 @@ def get_mapping(cls, metric):
def convert_mapping_to_list(self, total_mapping, error_mapping, endpoint_names):
res = []
for index, name in enumerate(endpoint_names, 1):

error_rate = round(error_mapping[name] / total_mapping[name], 2) if total_mapping[name] else 0
if error_rate == 0:
color = NodeColor.Color.GREEN
Expand Down Expand Up @@ -240,7 +239,6 @@ class ApdexList(EndpointList):
metric = ApdexInstance

def list(self):

response = self.metric(
**self.common_params, **{"filter_dict": self.get_filter_dict(), "group_by": ["span_name"]}
).get_instance_calculate_values_mapping(
Expand Down