Skip to content

Commit

Permalink
add preload_statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
Olav van Schie committed Dec 23, 2019
1 parent 1853b40 commit 0691f02
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/Commands/Status.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ public function handle()
protected function displayTables($data)
{
$general = (array) $data;
unset($general['memory_usage'], $general['interned_strings_usage'], $general['opcache_statistics']);

foreach(['memory_usage', 'interned_strings_usage', 'opcache_statistics', 'preload_statistics'] as $unset) {
unset($general[$unset]);
}

$this->table([], $this->parseTable($general));

$this->line(PHP_EOL.'Memory usage:');
Expand All @@ -70,6 +74,11 @@ protected function displayTables($data)
$this->line(PHP_EOL.'Interned strings usage:');
$this->table([], $this->parseTable($data->interned_strings_usage));
}

if (isset($data->preload_statistics)) {
$this->line(PHP_EOL.'Preload statistics:');
$this->table([], $this->parseTable($data->preload_statistics));
}
}

/**
Expand Down Expand Up @@ -97,7 +106,7 @@ protected function parseTable($input)

return [
'key' => $key,
'value' => $value,
'value' => is_array($value) ? implode(PHP_EOL, $value) : $value,
];
}, array_keys($input), $input);
}
Expand Down

0 comments on commit 0691f02

Please sign in to comment.