mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
add process time to publish report
This commit is contained in:
parent
9955ffe95c
commit
1b8dff405a
1 changed files with 7 additions and 2 deletions
|
|
@ -3,6 +3,7 @@ import copy
|
|||
import logging
|
||||
import traceback
|
||||
import collections
|
||||
import time
|
||||
from abc import ABCMeta, abstractmethod, abstractproperty
|
||||
|
||||
import six
|
||||
|
|
@ -232,15 +233,17 @@ class PublishReport:
|
|||
"""Set that current plugin has been skipped."""
|
||||
self._current_plugin_data["skipped"] = True
|
||||
|
||||
def add_result(self, result):
|
||||
def add_result(self, result, process_time):
|
||||
"""Handle result of one plugin and it's instance."""
|
||||
|
||||
instance = result["instance"]
|
||||
instance_id = None
|
||||
if instance is not None:
|
||||
instance_id = instance.id
|
||||
self._current_plugin_data["instances_data"].append({
|
||||
"id": instance_id,
|
||||
"logs": self._extract_instance_log_items(result)
|
||||
"logs": self._extract_instance_log_items(result),
|
||||
"process_time": process_time
|
||||
})
|
||||
|
||||
def add_action_result(self, action, result):
|
||||
|
|
@ -2100,9 +2103,11 @@ class PublisherController(BasePublisherController):
|
|||
)
|
||||
|
||||
def _process_and_continue(self, plugin, instance):
|
||||
start = time.time()
|
||||
result = pyblish.plugin.process(
|
||||
plugin, self._publish_context, instance
|
||||
)
|
||||
process_time = time.time() - start
|
||||
|
||||
self._publish_report.add_result(result)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue