summaryrefslogtreecommitdiffstats
path: root/meta/classes/buildstats.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/buildstats.bbclass')
-rw-r--r--meta/classes/buildstats.bbclass24
1 files changed, 24 insertions, 0 deletions
diff --git a/meta/classes/buildstats.bbclass b/meta/classes/buildstats.bbclass
index 57ecc8fee8..9c0c37dcdd 100644
--- a/meta/classes/buildstats.bbclass
+++ b/meta/classes/buildstats.bbclass
@@ -188,3 +188,27 @@ python run_buildstats () {
188addhandler run_buildstats 188addhandler run_buildstats
189run_buildstats[eventmask] = "bb.event.BuildStarted bb.event.BuildCompleted bb.build.TaskStarted bb.build.TaskSucceeded bb.build.TaskFailed" 189run_buildstats[eventmask] = "bb.event.BuildStarted bb.event.BuildCompleted bb.build.TaskStarted bb.build.TaskSucceeded bb.build.TaskFailed"
190 190
191python runqueue_stats () {
192 import buildstats
193 from bb import event, runqueue
194 # We should not record any samples before the first task has started,
195 # because that's the first activity shown in the process chart.
196 # Besides, at that point we are sure that the build variables
197 # are available that we need to find the output directory.
198 # The persistent SystemStats is stored in the datastore and
199 # closed when the build is done.
200 system_stats = d.getVar('_buildstats_system_stats', True)
201 if not system_stats and isinstance(e, (bb.runqueue.sceneQueueTaskStarted, bb.runqueue.runQueueTaskStarted)):
202 system_stats = buildstats.SystemStats(d)
203 d.setVar('_buildstats_system_stats', system_stats)
204 if system_stats:
205 # Ensure that we sample at important events.
206 done = isinstance(e, bb.event.BuildCompleted)
207 system_stats.sample(force=done)
208 if done:
209 system_stats.close()
210 d.delVar('_buildstats_system_stats')
211}
212
213addhandler runqueue_stats
214runqueue_stats[eventmask] = "bb.runqueue.sceneQueueTaskStarted bb.runqueue.runQueueTaskStarted bb.event.HeartbeatEvent bb.event.BuildCompleted"