Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save BigRoy/b0afa918fc51936775f09acc476006e0 to your computer and use it in GitHub Desktop.
Save BigRoy/b0afa918fc51936775f09acc476006e0 to your computer and use it in GitHub Desktop.
OpenPype / AYON publisher json report get timings printout in seconds
import json
path = r"C:\Users\User\Downloads\publish-report-240730-17-33.json"
with open(path, "r") as f:
data = json.load(f)
for plugin_data in data["plugins_data"]:
label = plugin_data["label"]
instances_data = plugin_data["instances_data"]
if not instances_data:
continue
for instance_data in instances_data:
process_time = instance_data["process_time"]
if process_time == 0.0:
# Do not log the entries that were 0.0s
continue
process_time /= 1000 # ms to seconds
time_spent = "{0:.3f} s".format(process_time)
time_spent = time_spent.ljust(12)
print(time_spent, label)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment