diff options
Diffstat (limited to 'scripts/lib')
-rw-r--r-- | scripts/lib/build_perf/html/report.html | 60 | ||||
-rw-r--r-- | scripts/lib/buildstats.py | 8 |
2 files changed, 66 insertions, 2 deletions
diff --git a/scripts/lib/build_perf/html/report.html b/scripts/lib/build_perf/html/report.html index f983a4a09c..e56186c958 100644 --- a/scripts/lib/build_perf/html/report.html +++ b/scripts/lib/build_perf/html/report.html @@ -53,9 +53,11 @@ summary th, .meta-table td { border-collapse: collapse; } .details th { - font-weight: normal; padding-right: 8px; } +.details.plain th { + font-weight: normal; +} .preformatted { font-family: monospace; white-space: pre-wrap; @@ -168,6 +170,7 @@ h3 { {{ measurement.absdiff_str }} ({{measurement.reldiff}}) </span></span> </div> + {# Table for trendchart and the statistics #} <table style="width: 100%"> <tr> <td style="width: 75%"> @@ -176,7 +179,7 @@ h3 { </td> <td> {# Measurement statistics #} - <table class="details"> + <table class="details plain"> <tr> <th>Test runs</th><td>{{ measurement.value.sample_cnt }}</td> </tr><tr> @@ -195,6 +198,59 @@ h3 { </td> </tr> </table> + + {# Task and recipe summary from buildstats #} + {% if 'buildstats' in measurement %} + Task resource usage + <table class="details" style="width:100%"> + <tr> + <th>Number of tasks</th> + <th>Top consumers of cputime</th> + </tr> + <tr> + <td style="vertical-align: top">{{ measurement.buildstats.tasks.count }} ({{ measurement.buildstats.tasks.change }})</td> + {# Table of most resource-hungry tasks #} + <td> + <table class="details plain"> + {% for diff in measurement.buildstats.top_consumer|reverse %} + <tr> + <th>{{ diff.pkg }}.{{ diff.task }}</th> + <td>{{ '%0.0f' % diff.value2 }} s</td> + </tr> + {% endfor %} + </table> + </td> + </tr> + <tr> + <th>Biggest increase in cputime</th> + <th>Biggest decrease in cputime</th> + </tr> + <tr> + {# Table biggest increase in resource usage #} + <td> + <table class="details plain"> + {% for diff in measurement.buildstats.top_increase|reverse %} + <tr> + <th>{{ diff.pkg }}.{{ diff.task }}</th> + <td>{{ '%+0.0f' % diff.absdiff }} s</td> + </tr> + {% endfor %} + </table> + </td> + {# Table biggest decrease in resource usage #} + <td> + <table class="details plain"> + {% for diff in measurement.buildstats.top_decrease %} + <tr> + <th>{{ diff.pkg }}.{{ diff.task }}</th> + <td>{{ '%+0.0f' % diff.absdiff }} s</td> + </tr> + {% endfor %} + </table> + </td> + </tr> + </table> + {% endif %} </div> {% endfor %} {# Unsuccessful test #} diff --git a/scripts/lib/buildstats.py b/scripts/lib/buildstats.py index 9eb60b1c69..bd6332176a 100644 --- a/scripts/lib/buildstats.py +++ b/scripts/lib/buildstats.py @@ -180,6 +180,14 @@ class BSRecipe(object): class BuildStats(dict): """Class representing buildstats of one build""" + @property + def num_tasks(self): + """Get number of tasks""" + num = 0 + for recipe in self.values(): + num += len(recipe.tasks) + return num + @classmethod def from_json(cls, bs_json): """Create new BuildStats object from JSON object""" |