/** * Start profile * * @param mixed $context * @return Rediska_Profiler_Profile */ public function start($context) { $profile = new Rediska_Profiler_Profile($this, $context); $profile->start(); $this->_profiles[] = $profile; return $profile; }
/** * Stop callback. Called from profile * * @param Rediska_Profiler_Profile $profile */ public function stopCallback(Rediska_Profiler_Profile $profile) { $placeHolders = array('%timestamp%' => date('Y-m-d H:i:s'), '%profile%' => $profile->getContext(), '%elapsedTime%' => $profile->getElapsedTime(4)); $data = str_replace(array_keys($placeHolders), array_values($placeHolders), $this->_format . Rediska::EOL); $this->_write($data); }