Skip to content

Commit 47524c3

Browse files
committed
fix(Metrics): improve support for different --output flag
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
1 parent 59d988a commit 47524c3

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

lib/Command/Metrics.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int
5151
$output->writeln('<error>Invalid metrics received from push server</error>');
5252
return 1;
5353
}
54+
55+
// Output in the requested format if different from plain
56+
if ($input->getOption('output') !== self::OUTPUT_FORMAT_PLAIN) {
57+
$this->writeArrayInOutputFormat($input, $output, $metrics);
58+
return 0;
59+
}
60+
5461
$output->writeln('Active connection count: ' . $metrics['active_connection_count']);
5562
$output->writeln('Active user count: ' . $metrics['active_user_count']);
5663
$output->writeln('Total connection count: ' . $metrics['total_connection_count']);

0 commit comments

Comments
 (0)