Skip to contentSkip to conversation

buildhistory: show time spent writting buildhistory

PATCH New Martin Jansa 1 participant 1 message Jun 18, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 buildhistory: show time spent writting buildhistory

* 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

---
 meta/classes/buildhistory.bbclass | 4 ++++
 1 file changed, 4 insertions(+)
meta/classes/buildhistory.bbclass +4 -0
index 34709f3f88..e4e1897318 100644
@@ -841,11 +841,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'")
 }
Signature · 1 line
2.17.1