diff --git a/modules/statistics/bin/loganalyzer.php b/modules/statistics/bin/loganalyzer.php index 913fc416838ee79cdc4e77ea5c2c236e4bd0ed51..644b5d40dcb5c97fb7a3b5871b597fcd5d15e6b8 100755 --- a/modules/statistics/bin/loganalyzer.php +++ b/modules/statistics/bin/loganalyzer.php @@ -51,7 +51,7 @@ foreach($argv as $a) { } } -$aggregator = new sspmod_statistics_Aggregator(); +$aggregator = new sspmod_statistics_Aggregator(TRUE); $aggregator->dumpConfig(); $results = $aggregator->aggregate($debug); diff --git a/modules/statistics/lib/Aggregator.php b/modules/statistics/lib/Aggregator.php index d5314759b487b23ddec4dfb62ff0ddcb862b38e0..46e41f365b84479748c794d5d38c9d0f3df25a0f 100644 --- a/modules/statistics/lib/Aggregator.php +++ b/modules/statistics/lib/Aggregator.php @@ -12,11 +12,14 @@ class sspmod_statistics_Aggregator { private $statrules; private $offset; + private $fromcmdline; + /** * Constructor */ - public function __construct() { + public function __construct($fromcmdline = FALSE) { + $this->fromcmdline = $fromcmdline; $this->statconfig = SimpleSAML_Configuration::getConfig('module_statistics.php'); $this->statdir = $this->statconfig->getValue('statdir'); @@ -70,9 +73,9 @@ class sspmod_statistics_Aggregator { $content = $logparser->parseContent($logline); $action = trim($content[5]); - if (($i % 10000) == 0) { - echo("Read line " . $i . "\n"); - } + if ($this->fromcmdline && ($i % 10000) == 0) { + echo("Read line " . $i . "\n"); + } if ($debug) {