diff --git a/src/Command/HealthCheckJsonCommand.php b/src/Command/HealthCheckJsonCommand.php new file mode 100644 index 00000000..ec3d2a50 --- /dev/null +++ b/src/Command/HealthCheckJsonCommand.php @@ -0,0 +1,39 @@ +healthCheckers as $checker) { + $checker->collect($collection); + } + + $output->writeln(json_encode($collection, \JSON_PRETTY_PRINT | \JSON_THROW_ON_ERROR)); + + return Command::SUCCESS; + } +} diff --git a/src/Command/RedisNamespaceCleanupCommand.php b/src/Command/RedisNamespaceCleanupCommand.php index c7041496..1614a5d6 100644 --- a/src/Command/RedisNamespaceCleanupCommand.php +++ b/src/Command/RedisNamespaceCleanupCommand.php @@ -71,7 +71,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (!isset($namespaces[$namespace])) { $namespaces[$namespace] = [ 'count' => 0, - 'isActive' => $this->isActiveNamespace($namespace, $activeNamespaces) + 'isActive' => $this->isActiveNamespace($namespace, $activeNamespaces), ]; } ++$namespaces[$namespace]['count'];