Skip to content

Commit 9e93d1c

Browse files
author
Jeremy Smith
authored
Optimisation for AVG run time (#317)
Hi ! If you have a task with a lot of results, the average run time calculation take too long... it's now fixed using the relation and not loading all results !
1 parent aaa90ac commit 9e93d1c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

resources/views/tasks/view.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
</li>
5656
<li>
5757
<span class="uk-text-muted uk-float-right">Average Run Time</span>
58-
<span class="uk-float-left">{{$task->results->count() > 0 ? number_format( $task->results->sum('duration') / (1000 * $task->results->count()) , 2) : '0'}} seconds</span>
58+
<span class="uk-float-left">{{$task->results()->count() > 0 ? number_format( $task->results()->sum('duration') / (1000 * $task->results()->count()) , 2) : '0'}} seconds</span>
5959
</li>
6060
<li>
6161
<span class="uk-text-muted uk-float-right">Next Run Schedule</span>

0 commit comments

Comments
 (0)