Skip to content

Commit

Permalink
docs: add comment on total duration behavior
Browse files Browse the repository at this point in the history
Signed-off-by: Guilhem Barthés <guilhem.barthes@owkin.com>
  • Loading branch information
guilhem-barthes committed Jul 19, 2024
1 parent f1e843f commit 1ced0e3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backend/api/serializers/task_profiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ class Meta:
def get_duration(self, function: Function) -> Union[str, None]:
counter_steps = len(orchestrator.FunctionProfilingStep)

# Returns the total duration only when all steps are completed. This mimicks `TaskProfiling` behavior.
# This is used in the front-end, which shows the total breakdown only when all steps have been finished.
if function.profiling_steps.count() < counter_steps:
return None
return functools.reduce(
Expand Down

0 comments on commit 1ced0e3

Please sign in to comment.