/**
  * @param $options
  * @param integer $timeInMilliseconds 1sec = 1000ms
  * @return bool
  */
 public static function timerAndStop($options, $timeInMilliseconds)
 {
     if (self::init()) {
         return pinba_timer_add($options, $timeInMilliseconds);
     }
     return false;
 }
示例#2
0
 /**
  * Creates new timer. This timer is already stopped and have specified time value.
  *
  * @param array $tags an array of tags and their values in the form of "tag" => "value". Cannot contain numeric indexes for obvious reasons.
  * @param $value timer value for new timer.
  * @param array $data optional array with user data, not sent to the server.
  * @return resource
  */
 public static function add(array $tags, $value, array $data = [])
 {
     if (!self::isEnabled()) {
         return;
     }
     return pinba_timer_add($tags, $value, $data);
 }
 /**
  * Creates new timer. This timer is already stopped and have specified time value.
  *
  * @param array $tags An array of tags and their values in the form of "tag" => "value". Cannot contain numeric indexes for obvious reasons.
  * @param int $time Timer value for new timer
  * @return void
  */
 public function add(array $tags, $time)
 {
     if (!$this->_enabled) {
         return;
     }
     $tags = array_merge($this->_initTags, $tags);
     pinba_timer_add($tags, $time);
 }
示例#4
0
 /**
  * Creates stopped Pinba timer so it can be later flushed to Pinba
  *
  * @param array $tags
  * @param float $value
  */
 public function profile($tags, $value)
 {
     if ($this->worksWithoutPinba && $this->getClientUsed() === self::CLIENT_NONE) {
         return;
     }
     pinba_timer_add($this->formatTags($tags), $value);
 }