for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Queryr\Replicator\Cli\Import;
use Queryr\Replicator\Importer\ImportStats;
use Queryr\Replicator\Importer\StatsReporter;
use Symfony\Component\Console\Output\OutputInterface;
/**
* @licence GNU GPL v2+
* @author Jeroen De Dauw < [email protected] >
*/
class ConsoleStatsReporter implements StatsReporter {
private $output;
public function __construct( OutputInterface $output ) {
$this->output = $output;
}
public function reportStats( ImportStats $stats ) {
$this->output->writeln( "\n" );
$this->output->writeln( '<info>Import stats:</info>' );
$this->output->writeln(
sprintf(
'<comment>Entities: %d (%d succeeded, %d (%g%%) failed)</comment>',
$stats->getEntityCount(),
$stats->getSuccessCount(),
$stats->getErrorCount(),
$stats->getErrorRatio()
)
);
'<comment>Duration: %g seconds (%d entities/second)</comment>',
$stats->getDurationInMs(),
$stats->getEntityCount() / $stats->getDurationInMs()