protected static function finishQueryLog(&$queryLog, $result = false)
    {
        if ($queryLog == false) {
            return false;
        }

        // save finish time and number of affected rows
        $queryLog['time_finish'] = sprintf('%f', microtime(true));
        $queryLog['time_duration_ms'] = ($queryLog['time_finish'] - $queryLog['time_start']) * 1000;

        // save result information
        if ($result) {
            $queryLog['result_fields'] = $result->field_count;
            $queryLog['result_rows'] = $result->num_rows;
        }

        // build backtrace string
        // TODO: figure out a nice toString option that isn't too bulky
        //$queryLog['backtrace'] = debug_backtrace();

        // monolog here
    }
protected static function finishQueryLog(&$queryLog, $result = false)
    {
        if ($queryLog == false) {
            return false;
        }

        // save finish time and number of affected rows
        $queryLog['time_finish'] = sprintf('%f', microtime(true));
        $queryLog['time_duration_ms'] = ($queryLog['time_finish'] - $queryLog['time_start']) * 1000;

        // save result information
        if ($result) {
            $queryLog['result_fields'] = $result->field_count;
            $queryLog['result_rows'] = $result->num_rows;
        }

        // build backtrace string
        // TODO: figure out a nice toString option that isn't too bulky
        //$queryLog['backtrace'] = debug_backtrace();

        // monolog here
    }
protected static function finishQueryLog ( & $ queryLog , $ result = false ) { if ( $ queryLog == false ) { return false ; } // save finish time and number of affected rows $ queryLog [ 'time_finish' ] = sprintf ( '%f' , microtime ( true ) ) ; $ queryLog [ 'time_duration_ms' ] = ( $ queryLog [ 'time_finish' ] - $ queryLog [ 'time_start' ] ) * 1000 ; // save result information if ( $ result ) { $ queryLog [ 'result_fields' ] = $ result -> field_count ; $ queryLog [ 'result_rows' ] = $ result -> num_rows ; } // build backtrace string // TODO: figure out a nice toString option that isn't too bulky //$queryLog['backtrace'] = debug_backtrace(); // monolog here }
Uses the log array created by startQueryLog and sets 'time_finish' on it as well as 'time_duration_ms'

If a PDO result is passed it will also set 'result_fields' and 'result_rows' on the passed in array.

Probably gonna remove this entirely. Query logging should be done via services like New Relic.

@param array|false $queryLog Passed by reference. The query log array created by startQueryLog
@param object|false $result The result from
@return void|false
Uses the log array created by startQueryLog and sets time_finish on it as well as time_duration_ms