Skip to content

Commit

Permalink
Merge pull request #606 from bonzai/format-numeric-values
Browse files Browse the repository at this point in the history
[3.0] Properly format numeric values
  • Loading branch information
taylorotwell authored Jun 3, 2019
2 parents 5951a48 + fe85572 commit b961435
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/SystemProcessCounter.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ public function getWorkerStats($name)
$rows = explode("\n", $process->getOutput());

return collect($rows)->filter()->map(function ($rows) {
$row = collect(explode(' ', $rows))->filter()->take(2);
$row = collect(explode(' ', $rows))->filter()->take(2)->map(function ($value) {
return str_replace(',', '.', $value);
});

return ['cpu' => $row->first() / 100, 'mem' => $row->last()];
});
Expand Down

0 comments on commit b961435

Please sign in to comment.