diff options
| -rw-r--r-- | bitbake/lib/bb/ui/buildinfohelper.py | 72 | ||||
| -rw-r--r-- | bitbake/lib/toaster/orm/migrations/0005_task_field_separation.py | 48 | ||||
| -rw-r--r-- | bitbake/lib/toaster/orm/models.py | 18 | ||||
| -rw-r--r-- | bitbake/lib/toaster/toastergui/templates/basebuildpage.html | 4 | ||||
| -rw-r--r-- | bitbake/lib/toaster/toastergui/templates/task.html | 23 | ||||
| -rw-r--r-- | bitbake/lib/toaster/toastergui/templates/tasks.html | 20 | ||||
| -rw-r--r-- | bitbake/lib/toaster/toastergui/urls.py | 2 | ||||
| -rwxr-xr-x | bitbake/lib/toaster/toastergui/views.py | 55 |
8 files changed, 163 insertions, 79 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py index 81abede803..7fedb76911 100644 --- a/bitbake/lib/bb/ui/buildinfohelper.py +++ b/bitbake/lib/bb/ui/buildinfohelper.py | |||
| @@ -50,6 +50,7 @@ from bb.msg import BBLogFormatter as formatter | |||
| 50 | from django.db import models | 50 | from django.db import models |
| 51 | from pprint import pformat | 51 | from pprint import pformat |
| 52 | import logging | 52 | import logging |
| 53 | from datetime import datetime, timedelta | ||
| 53 | 54 | ||
| 54 | from django.db import transaction, connection | 55 | from django.db import transaction, connection |
| 55 | 56 | ||
| @@ -120,6 +121,12 @@ class ORMWrapper(object): | |||
| 120 | 121 | ||
| 121 | return vars(self)[dictname][key] | 122 | return vars(self)[dictname][key] |
| 122 | 123 | ||
| 124 | def _timestamp_to_datetime(self, secs): | ||
| 125 | """ | ||
| 126 | Convert timestamp in seconds to Python datetime | ||
| 127 | """ | ||
| 128 | return datetime(1970, 1, 1) + timedelta(seconds=secs) | ||
| 129 | |||
| 123 | # pylint: disable=no-self-use | 130 | # pylint: disable=no-self-use |
| 124 | # we disable detection of no self use in functions because the methods actually work on the object | 131 | # we disable detection of no self use in functions because the methods actually work on the object |
| 125 | # even if they don't touch self anywhere | 132 | # even if they don't touch self anywhere |
| @@ -223,6 +230,28 @@ class ORMWrapper(object): | |||
| 223 | target.license_manifest_path = license_manifest_path | 230 | target.license_manifest_path = license_manifest_path |
| 224 | target.save() | 231 | target.save() |
| 225 | 232 | ||
| 233 | def update_task_object(self, build, task_name, recipe_name, task_stats): | ||
| 234 | """ | ||
| 235 | Find the task for build which matches the recipe and task name | ||
| 236 | to be stored | ||
| 237 | """ | ||
| 238 | task_to_update = Task.objects.get( | ||
| 239 | build = build, | ||
| 240 | task_name = task_name, | ||
| 241 | recipe__name = recipe_name | ||
| 242 | ) | ||
| 243 | |||
| 244 | task_to_update.started = self._timestamp_to_datetime(task_stats['started']) | ||
| 245 | task_to_update.ended = self._timestamp_to_datetime(task_stats['ended']) | ||
| 246 | task_to_update.elapsed_time = (task_stats['ended'] - task_stats['started']) | ||
| 247 | task_to_update.cpu_time_user = task_stats['cpu_time_user'] | ||
| 248 | task_to_update.cpu_time_system = task_stats['cpu_time_system'] | ||
| 249 | task_to_update.disk_io_read = task_stats['disk_io_read'] | ||
| 250 | task_to_update.disk_io_write = task_stats['disk_io_write'] | ||
| 251 | task_to_update.disk_io = task_stats['disk_io_read'] + task_stats['disk_io_write'] | ||
| 252 | |||
| 253 | task_to_update.save() | ||
| 254 | |||
| 226 | def get_update_task_object(self, task_information, must_exist = False): | 255 | def get_update_task_object(self, task_information, must_exist = False): |
| 227 | assert 'build' in task_information | 256 | assert 'build' in task_information |
| 228 | assert 'recipe' in task_information | 257 | assert 'recipe' in task_information |
| @@ -259,14 +288,6 @@ class ORMWrapper(object): | |||
| 259 | task_object.sstate_result = Task.SSTATE_FAILED | 288 | task_object.sstate_result = Task.SSTATE_FAILED |
| 260 | object_changed = True | 289 | object_changed = True |
| 261 | 290 | ||
| 262 | # mark down duration if we have a start time and a current time | ||
| 263 | if 'start_time' in task_information.keys() and 'end_time' in task_information.keys(): | ||
| 264 | duration = task_information['end_time'] - task_information['start_time'] | ||
| 265 | task_object.elapsed_time = duration | ||
| 266 | object_changed = True | ||
| 267 | del task_information['start_time'] | ||
| 268 | del task_information['end_time'] | ||
| 269 | |||
| 270 | if object_changed: | 291 | if object_changed: |
| 271 | task_object.save() | 292 | task_object.save() |
| 272 | return task_object | 293 | return task_object |
| @@ -1091,31 +1112,11 @@ class BuildInfoHelper(object): | |||
| 1091 | 1112 | ||
| 1092 | 1113 | ||
| 1093 | def store_tasks_stats(self, event): | 1114 | def store_tasks_stats(self, event): |
| 1094 | for (taskfile, taskname, taskstats, recipename) in BuildInfoHelper._get_data_from_event(event): | 1115 | task_data = BuildInfoHelper._get_data_from_event(event) |
| 1095 | localfilepath = taskfile.split(":")[-1] | ||
| 1096 | assert localfilepath.startswith("/") | ||
| 1097 | 1116 | ||
| 1098 | recipe_information = self._get_recipe_information_from_taskfile(taskfile) | 1117 | for (task_file, task_name, task_stats, recipe_name) in task_data: |
| 1099 | try: | 1118 | build = self.internal_state['build'] |
| 1100 | if recipe_information['file_path'].startswith(recipe_information['layer_version'].local_path): | 1119 | self.orm_wrapper.update_task_object(build, task_name, recipe_name, task_stats) |
| 1101 | recipe_information['file_path'] = recipe_information['file_path'][len(recipe_information['layer_version'].local_path):].lstrip("/") | ||
| 1102 | |||
| 1103 | recipe_object = Recipe.objects.get(layer_version = recipe_information['layer_version'], | ||
| 1104 | file_path__endswith = recipe_information['file_path'], | ||
| 1105 | name = recipename) | ||
| 1106 | except Recipe.DoesNotExist: | ||
| 1107 | logger.error("Could not find recipe for recipe_information %s name %s" , pformat(recipe_information), recipename) | ||
| 1108 | raise | ||
| 1109 | |||
| 1110 | task_information = {} | ||
| 1111 | task_information['build'] = self.internal_state['build'] | ||
| 1112 | task_information['recipe'] = recipe_object | ||
| 1113 | task_information['task_name'] = taskname | ||
| 1114 | task_information['cpu_usage'] = taskstats['cpu_usage'] | ||
| 1115 | task_information['disk_io'] = taskstats['disk_io'] | ||
| 1116 | if 'elapsed_time' in taskstats: | ||
| 1117 | task_information['elapsed_time'] = taskstats['elapsed_time'] | ||
| 1118 | self.orm_wrapper.get_update_task_object(task_information) | ||
| 1119 | 1120 | ||
| 1120 | def update_and_store_task(self, event): | 1121 | def update_and_store_task(self, event): |
| 1121 | assert 'taskfile' in vars(event) | 1122 | assert 'taskfile' in vars(event) |
| @@ -1137,13 +1138,6 @@ class BuildInfoHelper(object): | |||
| 1137 | recipe = self.orm_wrapper.get_update_recipe_object(recipe_information, True) | 1138 | recipe = self.orm_wrapper.get_update_recipe_object(recipe_information, True) |
| 1138 | task_information = self._get_task_information(event,recipe) | 1139 | task_information = self._get_task_information(event,recipe) |
| 1139 | 1140 | ||
| 1140 | if 'time' in vars(event): | ||
| 1141 | if not 'start_time' in self.internal_state['taskdata'][identifier]: | ||
| 1142 | self.internal_state['taskdata'][identifier]['start_time'] = event.time | ||
| 1143 | else: | ||
| 1144 | task_information['end_time'] = event.time | ||
| 1145 | task_information['start_time'] = self.internal_state['taskdata'][identifier]['start_time'] | ||
| 1146 | |||
| 1147 | task_information['outcome'] = self.internal_state['taskdata'][identifier]['outcome'] | 1141 | task_information['outcome'] = self.internal_state['taskdata'][identifier]['outcome'] |
| 1148 | 1142 | ||
| 1149 | if 'logfile' in vars(event): | 1143 | if 'logfile' in vars(event): |
diff --git a/bitbake/lib/toaster/orm/migrations/0005_task_field_separation.py b/bitbake/lib/toaster/orm/migrations/0005_task_field_separation.py new file mode 100644 index 0000000000..fb1196b566 --- /dev/null +++ b/bitbake/lib/toaster/orm/migrations/0005_task_field_separation.py | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | # -*- coding: utf-8 -*- | ||
| 2 | from __future__ import unicode_literals | ||
| 3 | |||
| 4 | from django.db import migrations, models | ||
| 5 | |||
| 6 | |||
| 7 | class Migration(migrations.Migration): | ||
| 8 | |||
| 9 | dependencies = [ | ||
| 10 | ('orm', '0004_provides'), | ||
| 11 | ] | ||
| 12 | |||
| 13 | operations = [ | ||
| 14 | migrations.RemoveField( | ||
| 15 | model_name='task', | ||
| 16 | name='cpu_usage', | ||
| 17 | ), | ||
| 18 | migrations.AddField( | ||
| 19 | model_name='task', | ||
| 20 | name='cpu_time_system', | ||
| 21 | field=models.DecimalField(null=True, max_digits=8, decimal_places=2), | ||
| 22 | ), | ||
| 23 | migrations.AddField( | ||
| 24 | model_name='task', | ||
| 25 | name='cpu_time_user', | ||
| 26 | field=models.DecimalField(null=True, max_digits=8, decimal_places=2), | ||
| 27 | ), | ||
| 28 | migrations.AddField( | ||
| 29 | model_name='task', | ||
| 30 | name='disk_io_read', | ||
| 31 | field=models.IntegerField(null=True), | ||
| 32 | ), | ||
| 33 | migrations.AddField( | ||
| 34 | model_name='task', | ||
| 35 | name='disk_io_write', | ||
| 36 | field=models.IntegerField(null=True), | ||
| 37 | ), | ||
| 38 | migrations.AddField( | ||
| 39 | model_name='task', | ||
| 40 | name='ended', | ||
| 41 | field=models.DateTimeField(null=True), | ||
| 42 | ), | ||
| 43 | migrations.AddField( | ||
| 44 | model_name='task', | ||
| 45 | name='started', | ||
| 46 | field=models.DateTimeField(null=True), | ||
| 47 | ), | ||
| 48 | ] | ||
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index f9c4fb0508..cfc6ea87c2 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py | |||
| @@ -723,9 +723,23 @@ class Task(models.Model): | |||
| 723 | work_directory = models.FilePathField(max_length=255, blank=True) | 723 | work_directory = models.FilePathField(max_length=255, blank=True) |
| 724 | script_type = models.IntegerField(choices=TASK_CODING, default=CODING_NA) | 724 | script_type = models.IntegerField(choices=TASK_CODING, default=CODING_NA) |
| 725 | line_number = models.IntegerField(default=0) | 725 | line_number = models.IntegerField(default=0) |
| 726 | disk_io = models.IntegerField(null=True) | 726 | |
| 727 | cpu_usage = models.DecimalField(max_digits=8, decimal_places=2, null=True) | 727 | # start/end times |
| 728 | started = models.DateTimeField(null=True) | ||
| 729 | ended = models.DateTimeField(null=True) | ||
| 730 | |||
| 731 | # in seconds; this is stored to enable sorting | ||
| 728 | elapsed_time = models.DecimalField(max_digits=8, decimal_places=2, null=True) | 732 | elapsed_time = models.DecimalField(max_digits=8, decimal_places=2, null=True) |
| 733 | |||
| 734 | # in bytes; note that disk_io is stored to enable sorting | ||
| 735 | disk_io = models.IntegerField(null=True) | ||
| 736 | disk_io_read = models.IntegerField(null=True) | ||
| 737 | disk_io_write = models.IntegerField(null=True) | ||
| 738 | |||
| 739 | # in seconds | ||
| 740 | cpu_time_user = models.DecimalField(max_digits=8, decimal_places=2, null=True) | ||
| 741 | cpu_time_system = models.DecimalField(max_digits=8, decimal_places=2, null=True) | ||
| 742 | |||
| 729 | sstate_result = models.IntegerField(choices=SSTATE_RESULT, default=SSTATE_NA) | 743 | sstate_result = models.IntegerField(choices=SSTATE_RESULT, default=SSTATE_NA) |
| 730 | message = models.CharField(max_length=240) | 744 | message = models.CharField(max_length=240) |
| 731 | logfile = models.FilePathField(max_length=255, blank=True) | 745 | logfile = models.FilePathField(max_length=255, blank=True) |
diff --git a/bitbake/lib/toaster/toastergui/templates/basebuildpage.html b/bitbake/lib/toaster/toastergui/templates/basebuildpage.html index 0dc71f5e5e..ff9433eee7 100644 --- a/bitbake/lib/toaster/toastergui/templates/basebuildpage.html +++ b/bitbake/lib/toaster/toastergui/templates/basebuildpage.html | |||
| @@ -67,8 +67,8 @@ | |||
| 67 | {% block nav-buildtime %} | 67 | {% block nav-buildtime %} |
| 68 | <li><a href="{% url 'buildtime' build.pk %}">Time</a></li> | 68 | <li><a href="{% url 'buildtime' build.pk %}">Time</a></li> |
| 69 | {% endblock %} | 69 | {% endblock %} |
| 70 | {% block nav-cpuusage %} | 70 | {% block nav-cputime %} |
| 71 | <li><a href="{% url 'cpuusage' build.pk %}">CPU usage</a></li> | 71 | <li><a href="{% url 'cputime' build.pk %}">CPU time</a></li> |
| 72 | {% endblock %} | 72 | {% endblock %} |
| 73 | {% block nav-diskio %} | 73 | {% block nav-diskio %} |
| 74 | <li><a href="{% url 'diskio' build.pk %}">Disk I/O</a></li> | 74 | <li><a href="{% url 'diskio' build.pk %}">Disk I/O</a></li> |
diff --git a/bitbake/lib/toaster/toastergui/templates/task.html b/bitbake/lib/toaster/toastergui/templates/task.html index ef628d9f9b..5768262432 100644 --- a/bitbake/lib/toaster/toastergui/templates/task.html +++ b/bitbake/lib/toaster/toastergui/templates/task.html | |||
| @@ -238,7 +238,7 @@ | |||
| 238 | </dl> | 238 | </dl> |
| 239 | 239 | ||
| 240 | {# Performance section - shown only for executed tasks #} | 240 | {# Performance section - shown only for executed tasks #} |
| 241 | {%if task.elapsed_time or task.cpu_usage or task.disk_io %} | 241 | {%if task.elapsed_time or task.cpu_time_user or task.cpu_time_system or task.disk_io %} |
| 242 | <h2 class="details">Performance</h2> | 242 | <h2 class="details">Performance</h2> |
| 243 | {% endif %} | 243 | {% endif %} |
| 244 | <dl class="dl-horizontal"> | 244 | <dl class="dl-horizontal"> |
| @@ -249,19 +249,26 @@ | |||
| 249 | </dt> | 249 | </dt> |
| 250 | <dd>{{task.elapsed_time|format_none_and_zero|floatformat:2}}</dd> | 250 | <dd>{{task.elapsed_time|format_none_and_zero|floatformat:2}}</dd> |
| 251 | {% endif %} | 251 | {% endif %} |
| 252 | {% if task.cpu_usage > 0 %} | 252 | {% if task.cpu_time_user > 0 %} |
| 253 | <dt> | 253 | <dt> |
| 254 | <i class="icon-question-sign get-help" title="The percentage of task CPU utilization"></i> | 254 | <i class="icon-question-sign get-help" title="Total amount of time spent executing in user mode, in seconds. Note that this time can be greater than the task time due to parallel execution."></i> |
| 255 | CPU usage | 255 | User CPU time (secs) |
| 256 | </dt> | 256 | </dt> |
| 257 | <dd>{{task.cpu_usage|format_none_and_zero|floatformat:2}}%</dd> | 257 | <dd>{{task.cpu_time_user|format_none_and_zero|floatformat:2}}</dd> |
| 258 | {% endif %} | ||
| 259 | {% if task.cpu_time_system > 0 %} | ||
| 260 | <dt> | ||
| 261 | <i class="icon-question-sign get-help" title="Total amount of time spent executing in kernel mode, in seconds. Note that this time can be greater than the task time due to parallel execution."></i> | ||
| 262 | System CPU time (secs) | ||
| 263 | </dt> | ||
| 264 | <dd>{{task.cpu_time_system|format_none_and_zero|floatformat:2}}</dd> | ||
| 258 | {% endif %} | 265 | {% endif %} |
| 259 | {% if task.disk_io > 0 %} | 266 | {% if task.disk_io > 0 %} |
| 260 | <dt> | 267 | <dt> |
| 261 | <i class="icon-question-sign get-help" title="Number of miliseconds the task spent doing disk input and output"></i> | 268 | <i class="icon-question-sign get-help" title="Number of bytes written to and read from the disk during the task"></i> |
| 262 | Disk I/O (ms) | 269 | Disk I/O (bytes) |
| 263 | </dt> | 270 | </dt> |
| 264 | <dd>{{task.disk_io|format_none_and_zero}}</dd> | 271 | <dd>{{task.disk_io|format_none_and_zero|intcomma}}</dd> |
| 265 | {% endif %} | 272 | {% endif %} |
| 266 | </dl> | 273 | </dl> |
| 267 | 274 | ||
diff --git a/bitbake/lib/toaster/toastergui/templates/tasks.html b/bitbake/lib/toaster/toastergui/templates/tasks.html index 353410f92a..23eb957567 100644 --- a/bitbake/lib/toaster/toastergui/templates/tasks.html +++ b/bitbake/lib/toaster/toastergui/templates/tasks.html | |||
| @@ -1,4 +1,5 @@ | |||
| 1 | {% extends "basebuildpage.html" %} | 1 | {% extends "basebuildpage.html" %} |
| 2 | {% load humanize %} | ||
| 2 | {% load projecttags %} | 3 | {% load projecttags %} |
| 3 | 4 | ||
| 4 | {% block title %} {{mainheading}} - {{build.target_set.all|dictsort:"target"|join:", "}} {{build.machine}} - {{build.project.name}} - Toaster{% endblock %} | 5 | {% block title %} {{mainheading}} - {{build.target_set.all|dictsort:"target"|join:", "}} {{build.machine}} - {{build.project.name}} - Toaster{% endblock %} |
| @@ -20,13 +21,15 @@ | |||
| 20 | <li><a href="{% url 'buildtime' build.pk %}">Time</a></li> | 21 | <li><a href="{% url 'buildtime' build.pk %}">Time</a></li> |
| 21 | {% endif %} | 22 | {% endif %} |
| 22 | {% endblock %} | 23 | {% endblock %} |
| 23 | {% block nav-cpuusage %} | 24 | |
| 24 | {% if 'CPU usage' == mainheading %} | 25 | {% block nav-cputime %} |
| 25 | <li class="active"><a href="{% url 'cpuusage' build.pk %}">CPU usage</a></li> | 26 | {% if 'CPU time' == mainheading %} |
| 27 | <li class="active"><a href="{% url 'cputime' build.pk %}">CPU time</a></li> | ||
| 26 | {% else %} | 28 | {% else %} |
| 27 | <li><a href="{% url 'cpuusage' build.pk %}">CPU usage</a></li> | 29 | <li><a href="{% url 'cputime' build.pk %}">CPU time</a></li> |
| 28 | {% endif %} | 30 | {% endif %} |
| 29 | {% endblock %} | 31 | {% endblock %} |
| 32 | |||
| 30 | {% block nav-diskio %} | 33 | {% block nav-diskio %} |
| 31 | {% if 'Disk I/O' == mainheading %} | 34 | {% if 'Disk I/O' == mainheading %} |
| 32 | <li class="active"><a href="{% url 'diskio' build.pk %}">Disk I/O</a></li> | 35 | <li class="active"><a href="{% url 'diskio' build.pk %}">Disk I/O</a></li> |
| @@ -107,11 +110,14 @@ | |||
| 107 | <td class="time_taken"> | 110 | <td class="time_taken"> |
| 108 | {{task.elapsed_time|format_none_and_zero|floatformat:2}} | 111 | {{task.elapsed_time|format_none_and_zero|floatformat:2}} |
| 109 | </td> | 112 | </td> |
| 110 | <td class="cpu_used"> | 113 | <td class="cpu_time_system"> |
| 111 | {{task.cpu_usage|format_none_and_zero|floatformat:2}}{% if task.cpu_usage %}%{% endif %} | 114 | {{task.cpu_time_system|format_none_and_zero|floatformat:2}} |
| 115 | </td> | ||
| 116 | <td class="cpu_time_user"> | ||
| 117 | {{task.cpu_time_user|format_none_and_zero|floatformat:2}} | ||
| 112 | </td> | 118 | </td> |
| 113 | <td class="disk_io"> | 119 | <td class="disk_io"> |
| 114 | {{task.disk_io|format_none_and_zero}} | 120 | {{task.disk_io|format_none_and_zero|intcomma}} |
| 115 | </td> | 121 | </td> |
| 116 | 122 | ||
| 117 | </tr> | 123 | </tr> |
diff --git a/bitbake/lib/toaster/toastergui/urls.py b/bitbake/lib/toaster/toastergui/urls.py index 4aa64887b7..400580a235 100644 --- a/bitbake/lib/toaster/toastergui/urls.py +++ b/bitbake/lib/toaster/toastergui/urls.py | |||
| @@ -64,7 +64,7 @@ urlpatterns = patterns('toastergui.views', | |||
| 64 | url(r'^build/(?P<build_id>\d+)/configuration$', 'configuration', name='configuration'), | 64 | url(r'^build/(?P<build_id>\d+)/configuration$', 'configuration', name='configuration'), |
| 65 | url(r'^build/(?P<build_id>\d+)/configvars$', 'configvars', name='configvars'), | 65 | url(r'^build/(?P<build_id>\d+)/configvars$', 'configvars', name='configvars'), |
| 66 | url(r'^build/(?P<build_id>\d+)/buildtime$', 'buildtime', name='buildtime'), | 66 | url(r'^build/(?P<build_id>\d+)/buildtime$', 'buildtime', name='buildtime'), |
| 67 | url(r'^build/(?P<build_id>\d+)/cpuusage$', 'cpuusage', name='cpuusage'), | 67 | url(r'^build/(?P<build_id>\d+)/cputime$', 'cputime', name='cputime'), |
| 68 | url(r'^build/(?P<build_id>\d+)/diskio$', 'diskio', name='diskio'), | 68 | url(r'^build/(?P<build_id>\d+)/diskio$', 'diskio', name='diskio'), |
| 69 | 69 | ||
| 70 | # image information dir | 70 | # image information dir |
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index bd118920ab..85ca9be716 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
| @@ -1005,11 +1005,11 @@ def tasks_common(request, build_id, variant, task_anchor): | |||
| 1005 | object_search_display="disk I/O data" | 1005 | object_search_display="disk I/O data" |
| 1006 | filter_search_display="tasks" | 1006 | filter_search_display="tasks" |
| 1007 | (pagesize, orderby) = _get_parameters_values(request, 25, 'disk_io:-') | 1007 | (pagesize, orderby) = _get_parameters_values(request, 25, 'disk_io:-') |
| 1008 | elif 'cpuusage' == variant: | 1008 | elif 'cputime' == variant: |
| 1009 | title_variant='CPU usage' | 1009 | title_variant='CPU time' |
| 1010 | object_search_display="CPU usage data" | 1010 | object_search_display="CPU time data" |
| 1011 | filter_search_display="tasks" | 1011 | filter_search_display="tasks" |
| 1012 | (pagesize, orderby) = _get_parameters_values(request, 25, 'cpu_usage:-') | 1012 | (pagesize, orderby) = _get_parameters_values(request, 25, 'cpu_time_system:-') |
| 1013 | else : | 1013 | else : |
| 1014 | title_variant='Tasks' | 1014 | title_variant='Tasks' |
| 1015 | object_search_display="tasks" | 1015 | object_search_display="tasks" |
| @@ -1161,23 +1161,38 @@ def tasks_common(request, build_id, variant, task_anchor): | |||
| 1161 | del tc_time['clclass'] | 1161 | del tc_time['clclass'] |
| 1162 | tc_cache['hidden']='1' | 1162 | tc_cache['hidden']='1' |
| 1163 | 1163 | ||
| 1164 | tc_cpu={ | 1164 | tc_cpu_time_system={ |
| 1165 | 'name':'CPU usage', | 1165 | 'name':'System CPU time (secs)', |
| 1166 | 'qhelp':'The percentage of task CPU utilization', | 1166 | 'qhelp':'Total amount of time spent executing in kernel mode, in ' + |
| 1167 | 'orderfield': _get_toggle_order(request, "cpu_usage", True), | 1167 | 'seconds. Note that this time can be greater than the task ' + |
| 1168 | 'ordericon':_get_toggle_order_icon(request, "cpu_usage"), | 1168 | 'time due to parallel execution.', |
| 1169 | 'orderkey' : 'cpu_usage', | 1169 | 'orderfield': _get_toggle_order(request, "cpu_time_system", True), |
| 1170 | 'clclass': 'cpu_used', 'hidden' : 1, | 1170 | 'ordericon':_get_toggle_order_icon(request, "cpu_time_system"), |
| 1171 | 'orderkey' : 'cpu_time_system', | ||
| 1172 | 'clclass': 'cpu_time_system', 'hidden' : 1, | ||
| 1171 | } | 1173 | } |
| 1172 | 1174 | ||
| 1173 | if 'cpuusage' == variant: | 1175 | tc_cpu_time_user={ |
| 1174 | tc_cpu['hidden']='0' | 1176 | 'name':'User CPU time (secs)', |
| 1175 | del tc_cpu['clclass'] | 1177 | 'qhelp':'Total amount of time spent executing in user mode, in seconds. ' + |
| 1178 | 'Note that this time can be greater than the task time due to ' + | ||
| 1179 | 'parallel execution.', | ||
| 1180 | 'orderfield': _get_toggle_order(request, "cpu_time_user", True), | ||
| 1181 | 'ordericon':_get_toggle_order_icon(request, "cpu_time_user"), | ||
| 1182 | 'orderkey' : 'cpu_time_user', | ||
| 1183 | 'clclass': 'cpu_time_user', 'hidden' : 1, | ||
| 1184 | } | ||
| 1185 | |||
| 1186 | if 'cputime' == variant: | ||
| 1187 | tc_cpu_time_system['hidden']='0' | ||
| 1188 | tc_cpu_time_user['hidden']='0' | ||
| 1189 | del tc_cpu_time_system['clclass'] | ||
| 1190 | del tc_cpu_time_user['clclass'] | ||
| 1176 | tc_cache['hidden']='1' | 1191 | tc_cache['hidden']='1' |
| 1177 | 1192 | ||
| 1178 | tc_diskio={ | 1193 | tc_diskio={ |
| 1179 | 'name':'Disk I/O (ms)', | 1194 | 'name':'Disk I/O (bytes)', |
| 1180 | 'qhelp':'Number of miliseconds the task spent doing disk input and output', | 1195 | 'qhelp':'Number of bytes written to and read from the disk during the task', |
| 1181 | 'orderfield': _get_toggle_order(request, "disk_io", True), | 1196 | 'orderfield': _get_toggle_order(request, "disk_io", True), |
| 1182 | 'ordericon':_get_toggle_order_icon(request, "disk_io"), | 1197 | 'ordericon':_get_toggle_order_icon(request, "disk_io"), |
| 1183 | 'orderkey' : 'disk_io', | 1198 | 'orderkey' : 'disk_io', |
| @@ -1208,7 +1223,8 @@ def tasks_common(request, build_id, variant, task_anchor): | |||
| 1208 | tc_outcome, | 1223 | tc_outcome, |
| 1209 | tc_cache, | 1224 | tc_cache, |
| 1210 | tc_time, | 1225 | tc_time, |
| 1211 | tc_cpu, | 1226 | tc_cpu_time_system, |
| 1227 | tc_cpu_time_user, | ||
| 1212 | tc_diskio, | 1228 | tc_diskio, |
| 1213 | ]} | 1229 | ]} |
| 1214 | 1230 | ||
| @@ -1229,9 +1245,8 @@ def buildtime(request, build_id): | |||
| 1229 | def diskio(request, build_id): | 1245 | def diskio(request, build_id): |
| 1230 | return tasks_common(request, build_id, 'diskio', '') | 1246 | return tasks_common(request, build_id, 'diskio', '') |
| 1231 | 1247 | ||
| 1232 | def cpuusage(request, build_id): | 1248 | def cputime(request, build_id): |
| 1233 | return tasks_common(request, build_id, 'cpuusage', '') | 1249 | return tasks_common(request, build_id, 'cputime', '') |
| 1234 | |||
| 1235 | 1250 | ||
| 1236 | def recipes(request, build_id): | 1251 | def recipes(request, build_id): |
| 1237 | template = 'recipes.html' | 1252 | template = 'recipes.html' |
