public function getProfileBetween($startSnapshot, $endSnapshot)
    {
        $profile = '';

        if ($this->slowTreshold) {
            if ($endSnapshot['microtime'] - $startSnapshot['microtime'] >= $this->slowTreshold) {
                $profile .= 'SLOW ';
            } else {
                $profile .= '     ';
            }
        }

        // Iterate through each detail that has been configured to be enabled
        foreach ($this->details as $detailName => $config) {
            switch ($detailName) {
                case 'time':
                    $value = self::formatDuration($endSnapshot['microtime'] - $startSnapshot['microtime'], $config['precision']);
                    break;
                case 'mem':
                    $value = self::formatMemory($endSnapshot['memoryUsage'], $config['precision']);
                    break;
                case 'memDelta':
                    $value = $endSnapshot['memoryUsage'] - $startSnapshot['memoryUsage'];
                    $value = ($value > 0 ? '+' : '') . self::formatMemory($value, $config['precision']);
                    break;
                case 'memPeak':
                    $value = self::formatMemory($endSnapshot['memoryPeakUsage'], $config['precision']);
                    break;
                default:
                    throw new InvalidConfigurationException("`$detailName` isn't a valid profiler key (Section: propel.runtime.profiler).");
                    break;
            }
            $profile .= $config['name'] . $this->innerGlue . str_pad($value, $config['pad'], ' ', STR_PAD_LEFT) . $this->outerGlue;

        }

        return $profile;
    }
public function getProfileBetween($startSnapshot, $endSnapshot)
    {
        $profile = '';

        if ($this->slowTreshold) {
            if ($endSnapshot['microtime'] - $startSnapshot['microtime'] >= $this->slowTreshold) {
                $profile .= 'SLOW ';
            } else {
                $profile .= '     ';
            }
        }

        // Iterate through each detail that has been configured to be enabled
        foreach ($this->details as $detailName => $config) {
            switch ($detailName) {
                case 'time':
                    $value = self::formatDuration($endSnapshot['microtime'] - $startSnapshot['microtime'], $config['precision']);
                    break;
                case 'mem':
                    $value = self::formatMemory($endSnapshot['memoryUsage'], $config['precision']);
                    break;
                case 'memDelta':
                    $value = $endSnapshot['memoryUsage'] - $startSnapshot['memoryUsage'];
                    $value = ($value > 0 ? '+' : '') . self::formatMemory($value, $config['precision']);
                    break;
                case 'memPeak':
                    $value = self::formatMemory($endSnapshot['memoryPeakUsage'], $config['precision']);
                    break;
                default:
                    throw new InvalidConfigurationException("`$detailName` isn't a valid profiler key (Section: propel.runtime.profiler).");
                    break;
            }
            $profile .= $config['name'] . $this->innerGlue . str_pad($value, $config['pad'], ' ', STR_PAD_LEFT) . $this->outerGlue;

        }

        return $profile;
    }
public function getProfileBetween ( $ startSnapshot , $ endSnapshot ) { $ profile = '' ; if ( $ this -> slowTreshold ) { if ( $ endSnapshot [ 'microtime' ] - $ startSnapshot [ 'microtime' ] >= $ this -> slowTreshold ) { $ profile .= 'SLOW ' ; } else { $ profile .= '     ' ; } } // Iterate through each detail that has been configured to be enabled foreach ( $ this -> details as $ detailName => $ config ) { switch ( $ detailName ) { case 'time' : $ value = self :: formatDuration ( $ endSnapshot [ 'microtime' ] - $ startSnapshot [ 'microtime' ] , $ config [ 'precision' ] ) ; break ; case 'mem' : $ value = self :: formatMemory ( $ endSnapshot [ 'memoryUsage' ] , $ config [ 'precision' ] ) ; break ; case 'memDelta' : $ value = $ endSnapshot [ 'memoryUsage' ] - $ startSnapshot [ 'memoryUsage' ] ; $ value = ( $ value > 0 ? '+' : '' ) . self :: formatMemory ( $ value , $ config [ 'precision' ] ) ; break ; case 'memPeak' : $ value = self :: formatMemory ( $ endSnapshot [ 'memoryPeakUsage' ] , $ config [ 'precision' ] ) ; break ; default : throw new InvalidConfigurationException ( "`$detailName` isn't a valid profiler key (Section: propel.runtime.profiler)." ) ; break ; } $ profile .= $ config [ 'name' ] . $ this -> innerGlue . str_pad ( $ value , $ config [ 'pad' ] , ' ' , STR_PAD_LEFT ) . $ this -> outerGlue ; } return $ profile ; }
Returns a string that may be prepended to a log line, containing debug information
according to the current configuration.

Uses two debug snapshots to calculate how much time has passed since the call to
self::start(), how much the memory consumption by PHP has changed etc.

@see self::getSnapshot()

@param array $startSnapshot A snapshot, as returned by self::getSnapshot().
@param array $endSnapshot   A snapshot, as returned by self::getSnapshot().

@return string
Returns a string that may be prepended to a log line containing debug information according to the current configuration .