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
Fixes #3946 : add a service to fetch nodes executions and use them for reporting #341
Fixes #3946 : add a service to fetch nodes executions and use them for reporting #341
Conversation
|
||
def findExecutionTimeByNode( | ||
nodeId : NodeId | ||
, beginDate: DateTime | ||
, endDate : Option[DateTime] | ||
) : Seq[DateTime] = { | ||
var query = "select distinct executiontimestamp from ruddersysevents where ruleId = 'hasPolicyServer-root' and component = 'common' and keyValue = 'EndRun' and nodeId = ? and executiontimestamp >= ?" | ||
var query = "select distinct date from reportsexecution where and nodeId = ? and date >= ?" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
" where and " is legit ?
In any case, perhaps the and is not necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where and is not legit
… by minimizing the number of query to the database
, x.endDate | ||
) | ||
) | ||
}.toMap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, if a given ruleId happen several time in the expectedConfigurationReports sequence, you will loose information ( (1,1), (1,2) ).toMap => [(1 -> 2)] )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but you can have it only once; there are no duplicate of rules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed by other mean, the pb is not in rules but in the argument type of the method (seq in place of set). And in fact, there is no real problem, it was more than the refactoring was mixing optimization and algo logic, and Nico found a clean way to refactor again to make the optimization part apparent (so that it is not lost in the futur).
I've updated the PR with your remarks |
…ry_for_execution_reports Fixes #3946 : add a service to fetch nodes executions and use them for reporting
Ust 3945/impl 3946/add repository for execution reports