Project

General

Profile

Actions

Bug #20310

closed

Method getByRulesCompliance used by API is highly inefficient

Added by Nicolas CHARLES over 2 years ago. Updated over 2 years ago.

Status:
Released
Priority:
N/A
Category:
Performance and scalability
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
To do
Fix check:
Checked
Regression:

Description

It starts by computing the targets of all groups, and then creates a map of ruleId -> computed-targets-of-said-rules with no answer as a compliance (A)

Then it construct for each rules the ByRuleRuleCompliance (B), but in there it
  1. construct a map of ComponentName, Seq[NodeId, ComponentStatusReports]
  2. use this map to convert to Seq of ByRuleComponentCompliance (without using the map property, could have been a seq)
  3. and in the conversion, it converts a List[NodeId, ValueReports] to a Map[NodeId, List[NodeId, ValueReports]], where it sorts the list by componentName, then takes the value of them, rather than using lightweight version of the list

finally, it concatenates A and B

I'm quite convinced that nothing from A remains after this operation


Related issues 1 (0 open1 closed)

Related to Rudder - Bug #20311: error in compliance computation from the API in 7.0RejectedVincent MEMBRÉActions
Actions

Also available in: Atom PDF