-
Notifications
You must be signed in to change notification settings - Fork 117
[feat] Evaluate and log all performance values before asserting them #334
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1039,21 +1039,27 @@ def check_performance(self): | |
| return | ||
|
|
||
| with os_ext.change_dir(self._stagedir): | ||
| # first check and print all values with references | ||
| value = {} | ||
| for tag, expr in self.perf_patterns.items(): | ||
| value = evaluate(expr) | ||
| value[tag] = evaluate(expr) | ||
| key = '%s:%s' % (self._current_partition.fullname, tag) | ||
| try: | ||
| ref, low_thres, high_thres = self.reference[key] | ||
| self._perf_logger.info( | ||
| 'value: %s, reference: %s' % | ||
| (value, self.reference[key]) | ||
| '%s, value: %s, reference: %s' % | ||
| (tag, value[tag], self.reference[key]) | ||
| ) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the logging, I suggest waiting for #213 to be merged (perhaps today). |
||
| ref, low_thres, high_thres = self.reference[key] | ||
| except KeyError: | ||
| raise SanityError( | ||
| "tag `%s' not resolved in references for `%s'" % | ||
| (tag, self._current_partition.fullname) | ||
| ) | ||
| evaluate(assert_reference(value, ref, low_thres, high_thres)) | ||
| for tag, expr in self.perf_patterns.items(): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no need to go over the Also, leave a blank line after the previous |
||
| key = '%s:%s' % (self._current_partition.fullname, tag) | ||
| ref, low_thres, high_thres = self.reference[key] | ||
| evaluate(assert_reference(value[tag], ref, low_thres, | ||
| high_thres)) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't understand very well the purpose of this nested loop here.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is not a nested loop. I needed to move the evaluation to an additional loop. The reason was that if one of the early reference comparison throw the assert the other values were not written to the log file. In this way first all values are written and then the comparison is performed.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are right, for some reason I overlooked the alignment! I see what you are trying to do. |
||
|
|
||
| def _copy_to_outputdir(self): | ||
| """Copy checks interesting files to the output directory.""" | ||
|
|
||
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.
Better call this
perf_values. I'd also change a bit the comment to "Evaluate all performance variables first, so as to log them, then assert them".