Skip to content

Commit 00461b1

Browse files
committed
Report how long publishing the results takes
After the tests of a branch, test.py rsyncs every library's results to libraries.openmodelica.org, four at a time. Print the wall time of that step per branch, and the five libraries whose rsync took longest, to tell a slow link apart from a few libraries with many files. Assisted-by: Claude Opus 5.5
1 parent 54cad4e commit 00461b1

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎test.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,7 @@ def referenceFilesVersion(c):
14471447
# gets a copy of it.
14481448
publishFailures = []
14491449
for (resultBranch, runner) in resultBranches:
1450+
syncTimes = {}
14501451
result_location = outputFor(resultBranch)
14511452
if result_location != "" and (isWin or noSync):
14521453
# Unlike the rsync path, this one is given the directory the branches live
@@ -1577,13 +1578,15 @@ def publishLibrary(libname):
15771578
# move results by sync operations (not available under win)
15781579
if result_location != "" and not isWin and not noSync:
15791580
result_location_libname = "%s/%s" % (result_location, libname)
1581+
syncStart = monotonic()
15801582
try:
15811583
check_output_log(["rsync", "-aR", "--delete-excluded", "--include-from=%s.files" % libname, "--exclude=*", "./", result_location_libname], cwd=stageRoot)
15821584
except:
15831585
makeRemoteDirs([libname])
15841586
check_output_log(["rsync", "-aR", "--delete-excluded", "--include-from=%s.files" % libname, "--exclude=*", "./", result_location_libname], cwd=stageRoot)
15851587
if (conf.get("referenceFiles") or "") != "" and dygraphs:
15861588
check_output_log(["rsync", "-a", dygraphs, result_location_libname+"/files"])
1589+
syncTimes[libname] = monotonic() - syncStart
15871590
else:
15881591
print("No Sync: result_location [%s] != "" and not isWin [%s] and not noSync [%s] : library: %s" % (result_location, isWin, noSync, libname))
15891592

@@ -1618,6 +1621,7 @@ def publishLibrary(libname):
16181621
pass
16191622

16201623
publishable = [l for l in stats_by_libname.keys() if l not in skipped_libs and ranRunner(l, runner)]
1624+
publishStart = monotonic()
16211625
if result_location != "" and not isWin and not noSync:
16221626
makeRemoteDirs(publishable)
16231627

@@ -1632,6 +1636,10 @@ def publishLibraryReportingFailure(libname):
16321636

16331637
publishFailures += [f for f in Parallel(n_jobs=PUBLISH_JOBS, backend="threading")
16341638
(delayed(publishLibraryReportingFailure)(libname) for libname in publishable) if f]
1639+
print("Publishing %d libraries of %s: %s" % (len(publishable), resultBranch, friendlyStr(monotonic()-publishStart)))
1640+
for (libname, t) in sorted(syncTimes.items(), key=lambda x: -x[1])[:5]:
1641+
print(" rsync %s: %s" % (libname, friendlyStr(t)))
1642+
sys.stdout.flush()
16351643

16361644
if clean:
16371645
for g in ["*.o","*.so","*.h","*.c","*.cpp","*.simsuccess","*.conf.json","*.tmpfiles","*.log","*.libs","OMCpp*","*.fmu*","temp_*", "*.exe", "HelloWorld.bat", "*.makefile", "*.mat","*.xml", "*.bin", "*.json"]:

0 commit comments

Comments
 (0)