openframeworks / openFrameworks

openFrameworks is a community-developed cross platform toolkit for creative coding in C++.
http://openframeworks.cc
Other
9.94k stars 2.55k forks source link

[actions] ideas #7942

Closed dimitre closed 1 month ago

dimitre commented 4 months ago

Some ideas for github actions.

Investigating slow steps

I'm sharing one quick script made in python to analyse logs and discover the most slow steps in actions in this case it is set to only show entries that takes more than 3 seconds to execute

#!/usr/bin/env python3

from datetime import datetime
lasttime = 0
items = []
with open("job-logs3.txt") as file:
    for item in file:
        item = item.replace('\ufeff', '')
        ts = item[:19].replace('T', ' ')
        line = item[29:].strip()

        d = datetime.strptime(ts, '%Y-%m-%d %H:%M:%S')
        if lasttime != 0:
            delta = d - lasttime
            obj = (d, line, delta)
            items.append(obj)
        lasttime = d

for l in items:
    if (l[2].total_seconds() > 3):
        print(l[2], l[0], l[1])
dimitre commented 4 months ago

closed by https://github.com/openframeworks/openFrameworks/pull/7947