summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/build_perf/html/report.html20
-rw-r--r--scripts/lib/buildstats.py15
2 files changed, 33 insertions, 2 deletions
diff --git a/scripts/lib/build_perf/html/report.html b/scripts/lib/build_perf/html/report.html
index e56186c958..291ad9d721 100644
--- a/scripts/lib/build_perf/html/report.html
+++ b/scripts/lib/build_perf/html/report.html
@@ -250,6 +250,26 @@ h3 {
250 </td> 250 </td>
251 </tr> 251 </tr>
252 </table> 252 </table>
253
254 {# Recipe version differences #}
255 {% if measurement.buildstats.ver_diff %}
256 <div style="margin-top: 16px">Recipe version changes</div>
257 <table class="details">
258 {% for head, recipes in measurement.buildstats.ver_diff.items() %}
259 <tr>
260 <th colspan="2">{{ head }}</th>
261 </tr>
262 {% for name, info in recipes|sort %}
263 <tr>
264 <td>{{ name }}</td>
265 <td>{{ info }}</td>
266 </tr>
267 {% endfor %}
268 {% endfor %}
269 </table>
270 {% else %}
271 <div style="margin-top: 16px">No recipe version changes detected</div>
272 {% endif %}
253 {% endif %} 273 {% endif %}
254 </div> 274 </div>
255 {% endfor %} 275 {% endfor %}
diff --git a/scripts/lib/buildstats.py b/scripts/lib/buildstats.py
index b1c9e617c6..d9aadf3cb8 100644
--- a/scripts/lib/buildstats.py
+++ b/scripts/lib/buildstats.py
@@ -157,9 +157,9 @@ class BSRecipe(object):
157 self.version = version 157 self.version = version
158 self.revision = revision 158 self.revision = revision
159 if epoch is None: 159 if epoch is None:
160 self.nevr = "{}-{}-{}".format(name, version, revision) 160 self.evr = "{}-{}".format(version, revision)
161 else: 161 else:
162 self.nevr = "{}-{}_{}-{}".format(name, epoch, version, revision) 162 self.evr = "{}_{}-{}".format(epoch, version, revision)
163 self.tasks = {} 163 self.tasks = {}
164 164
165 def aggregate(self, bsrecipe): 165 def aggregate(self, bsrecipe):
@@ -176,6 +176,10 @@ class BSRecipe(object):
176 self.tasks[taskname] = BSTaskAggregate([self.tasks[taskname]]) 176 self.tasks[taskname] = BSTaskAggregate([self.tasks[taskname]])
177 self.tasks[taskname].append(taskdata) 177 self.tasks[taskname].append(taskdata)
178 178
179 @property
180 def nevr(self):
181 return self.name + '-' + self.evr
182
179 183
180class BuildStats(dict): 184class BuildStats(dict):
181 """Class representing buildstats of one build""" 185 """Class representing buildstats of one build"""
@@ -323,6 +327,7 @@ class BSVerDiff(object):
323 self.vchanged = {} 327 self.vchanged = {}
324 self.rchanged = {} 328 self.rchanged = {}
325 self.unchanged = {} 329 self.unchanged = {}
330 self.empty_diff = False
326 331
327 common = recipes2.intersection(recipes1) 332 common = recipes2.intersection(recipes1)
328 if common: 333 if common:
@@ -336,3 +341,9 @@ class BSVerDiff(object):
336 self.rchanged[recipe] = rdiff 341 self.rchanged[recipe] = rdiff
337 else: 342 else:
338 self.unchanged[recipe] = rdiff 343 self.unchanged[recipe] = rdiff
344
345 if len(recipes1) == len(recipes2) == len(self.unchanged):
346 self.empty_diff = True
347
348 def __bool__(self):
349 return not self.empty_diff