]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
buildhistory: show time spent writting buildhistory jansa/warrior
authorMartin Jansa <Martin.Jansa@gmail.com>
Sat, 15 Jun 2019 06:55:13 +0000 (06:55 +0000)
committerMartin Jansa <Martin.Jansa@gmail.com>
Wed, 16 Sep 2020 13:25:19 +0000 (15:25 +0200)
* especially when pushing longer history to slow remote git server or when
  it timeouts during the push, it's useful to see where the time was actually
  spent

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
meta/classes/buildhistory.bbclass

index 19d434fa06b849acac013c4a3e8e189d746550c4..8829030ef8aa2cfd334ad629f64388c59aae1a84 100644 (file)
@@ -839,11 +839,15 @@ python buildhistory_eventhandler() {
             if e.data.getVar("BUILDHISTORY_COMMIT") == "1":
                 bb.note("Writing buildhistory")
                 bb.build.exec_func("buildhistory_write_sigs", d)
+                import time
+                start=time.time()
                 localdata = bb.data.createCopy(e.data)
                 localdata.setVar('BUILDHISTORY_BUILD_FAILURES', str(e._failures))
                 interrupted = getattr(e, '_interrupted', 0)
                 localdata.setVar('BUILDHISTORY_BUILD_INTERRUPTED', str(interrupted))
                 bb.build.exec_func("buildhistory_commit", localdata)
+                stop=time.time()
+                bb.note("Writing buildhistory took: %s seconds" % round(stop-start))
             else:
                 bb.note("No commit since BUILDHISTORY_COMMIT != '1'")
 }