Merge branch '1.0.x' into testing
This commit is contained in:
commit
dcca04fd6f
@ -65,12 +65,16 @@ class SQLStatsPlugin extends Plugin
|
|||||||
|
|
||||||
function cleanup()
|
function cleanup()
|
||||||
{
|
{
|
||||||
$this->log(LOG_INFO, sprintf('%d queries this hit (total = %d, avg = %d, max = %d, min = %d)',
|
if (count($this->queryTimes) == 0) {
|
||||||
count($this->queryTimes),
|
$this->log(LOG_INFO, sprintf('0 queries this hit.'));
|
||||||
array_sum($this->queryTimes),
|
} else {
|
||||||
array_sum($this->queryTimes)/count($this->queryTimes),
|
$this->log(LOG_INFO, sprintf('%d queries this hit (total = %d, avg = %d, max = %d, min = %d)',
|
||||||
max($this->queryTimes),
|
count($this->queryTimes),
|
||||||
min($this->queryTimes)));
|
array_sum($this->queryTimes),
|
||||||
|
array_sum($this->queryTimes)/count($this->queryTimes),
|
||||||
|
max($this->queryTimes),
|
||||||
|
min($this->queryTimes)));
|
||||||
|
}
|
||||||
|
|
||||||
$verbose = common_config('sqlstats', 'verbose');
|
$verbose = common_config('sqlstats', 'verbose');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user