[LNT] r237656 - Add repr to ComparisonResults for handy logging and debugging
Chris Matthews
cmatthews5 at apple.com
Mon May 18 18:59:14 PDT 2015
Author: cmatthews
Date: Mon May 18 20:59:14 2015
New Revision: 237656
URL: http://llvm.org/viewvc/llvm-project?rev=237656&view=rev
Log:
Add repr to ComparisonResults for handy logging and debugging
Modified:
lnt/trunk/lnt/server/reporting/analysis.py
Modified: lnt/trunk/lnt/server/reporting/analysis.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/reporting/analysis.py?rev=237656&r1=237655&r2=237656&view=diff
==============================================================================
--- lnt/trunk/lnt/server/reporting/analysis.py (original)
+++ lnt/trunk/lnt/server/reporting/analysis.py Mon May 18 20:59:14 2015
@@ -45,6 +45,25 @@ class ComparisonResult:
self.confidence_lv = confidence_lv
self.bigger_is_better = bigger_is_better
+ def __repr__(self):
+ """Print this ComparisonResult's constructor.
+
+ Handy for generating test cases for comparisons doing odd things."""
+ frmt = "{}(" + "{}, " * 11 + ")"
+ return frmt.format("ComparisonResult",
+ self.current,
+ self.previous,
+ self.delta,
+ self.pct_delta,
+ self.stddev,
+ self.MAD,
+ self.failed,
+ self.prev_failed,
+ self.samples,
+ self.prev_samples,
+ self.stddev_mean,
+ self.confidence_lv,
+ self.bigger_is_better)
def is_result_interesting(self):
"""is_result_interesting() -> bool
More information about the llvm-commits
mailing list