]> code.ossystems Code Review - openembedded-core.git/commitdiff
buildhistory: show time spent writting buildhistory
authorMartin Jansa <martin.jansa@gmail.com>
Tue, 18 Jun 2019 07:51:31 +0000 (07:51 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 18 Jun 2019 14:55:59 +0000 (15:55 +0100)
* 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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/buildhistory.bbclass

index 796f68cf8f60bfbd8a96cf35a917e41a25786924..2e501df24b4f3311ef04f31c4811ec93ba0952f6 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'")
 }