Merge pull request #4382 from vishwamartur/fix-metrics-error
Fix metrics error when data is less than selected date
This commit is contained in:
commit
8fa1fc4df3
1 changed files with 2 additions and 1 deletions
|
|
@ -611,7 +611,8 @@ public function getMemoryMetrics(int $mins = 5)
|
|||
}
|
||||
$memory = json_decode($memory, true);
|
||||
$parsedCollection = collect($memory)->map(function ($metric) {
|
||||
return [(int) $metric['time'], (float) $metric['usedPercent']];
|
||||
$usedPercent = $metric['usedPercent'] ?? 0.0;
|
||||
return [(int) $metric['time'], (float) $usedPercent];
|
||||
});
|
||||
|
||||
return $parsedCollection->toArray();
|
||||
|
|
|
|||
Loading…
Reference in a new issue