Fixing history
This commit is contained in:
parent
3852ef2945
commit
f20adb7f28
1 changed files with 2 additions and 3 deletions
|
@ -98,6 +98,8 @@ class ApiController extends Controller
|
||||||
// Then we populate the stats data
|
// Then we populate the stats data
|
||||||
$prev = null;
|
$prev = null;
|
||||||
if (! is_null($history)) {
|
if (! is_null($history)) {
|
||||||
|
$history = $history->reverse();
|
||||||
|
|
||||||
foreach ($history as $k => $r) {
|
foreach ($history as $k => $r) {
|
||||||
if (empty($stats['uptime'][$r->date])) {
|
if (empty($stats['uptime'][$r->date])) {
|
||||||
$stats['uptime'][$r->date] = [
|
$stats['uptime'][$r->date] = [
|
||||||
|
@ -116,9 +118,6 @@ class ApiController extends Controller
|
||||||
|
|
||||||
// Populating the response times
|
// Populating the response times
|
||||||
if ($r->status == 1) {
|
if ($r->status == 1) {
|
||||||
// array_push($stats['times'][$r->date], [
|
|
||||||
// 'durations' => $r->duration
|
|
||||||
// ]);
|
|
||||||
$stats['times'][$r->date]['duration'] += $r->duration;
|
$stats['times'][$r->date]['duration'] += $r->duration;
|
||||||
$stats['times'][$r->date]['count'] ++;
|
$stats['times'][$r->date]['count'] ++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue