diff options
author | Elliot Smith <elliot.smith@intel.com> | 2016-03-08 11:32:12 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-03-09 22:45:16 +0000 |
commit | 0dcab0258e6e638db8b78fa3c7c7e485280712d4 (patch) | |
tree | 1d5fe7bafd6c45b8f935f0f516cc4d0309469eac /bitbake/lib/toaster/orm | |
parent | cc74a8ae26a7728828a3442ba441b1676bc2c8a1 (diff) | |
download | poky-0dcab0258e6e638db8b78fa3c7c7e485280712d4.tar.gz |
bitbake: toaster: rework task buildstats storage and display
The data available from buildstats is now more fine grained than
previously, so take advantage of that to enrich the data we save
against tasks:
* Store the CPU usage for user and system separately, and display
them separately.
* Disk IO is now measured in bytes, not ms. Also store the
read/write bytes separately.
* Store started and ended times, as well as elapsed_time. This
will enable future features such as showing which tasks were
running at a particular point in the build.
There was also a problem with how we were looking up the Task
object, which meant that the buildstats were being added to
new tasks which weren't correctly associated with the build. Fix
how we look up the Task (only looking for tasks which match the
build, and the task and recipe names in the build stats data) so
the build stats are associated with the correct task.
[YOCTO #8842]
(Bitbake rev: efa6f915566b979bdbad233ae195b413cef1b8da)
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/orm')
-rw-r--r-- | bitbake/lib/toaster/orm/migrations/0005_task_field_separation.py | 48 | ||||
-rw-r--r-- | bitbake/lib/toaster/orm/models.py | 18 |
2 files changed, 64 insertions, 2 deletions
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) |