|
|
@ -31,7 +31,9 @@ class DumpStatsCommand extends Command |
|
|
|
|
|
|
|
|
|
|
|
protected function configure() |
|
|
|
protected function configure() |
|
|
|
{ |
|
|
|
{ |
|
|
|
$this->setName('stats:dump')->addOption('module', 'm', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Modules to fetch statistics for'); |
|
|
|
$this->setName('stats:dump') |
|
|
|
|
|
|
|
->addOption('module', 'm', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Modules to fetch statistics for') |
|
|
|
|
|
|
|
->addOption('raw', null, InputOption::VALUE_NONE, 'Output raw statistics list'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected function execute(InputInterface $input, OutputInterface $output) |
|
|
|
protected function execute(InputInterface $input, OutputInterface $output) |
|
|
@ -52,11 +54,16 @@ class DumpStatsCommand extends Command |
|
|
|
'Value' |
|
|
|
'Value' |
|
|
|
]); |
|
|
|
]); |
|
|
|
foreach ($event->getStatistics() as $name => $value) { |
|
|
|
foreach ($event->getStatistics() as $name => $value) { |
|
|
|
|
|
|
|
if ($input->getOption('raw')) { |
|
|
|
|
|
|
|
$output->writeln($name . "\t" . $value, OutputInterface::OUTPUT_RAW); |
|
|
|
|
|
|
|
} |
|
|
|
$table->addRow([ |
|
|
|
$table->addRow([ |
|
|
|
$name, |
|
|
|
$name, |
|
|
|
$value |
|
|
|
$value |
|
|
|
]); |
|
|
|
]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (!$input->getOption('raw')) { |
|
|
|
$table->render(); |
|
|
|
$table->render(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |