Exemplo n.º 1
0
 public function __construct($host = SocketMemcached::DEFAULT_HOST, $port = SocketMemcached::DEFAULT_PORT, $buffer = SocketMemcached::DEFAULT_BUFFER)
 {
     if (PinbaClient::isEnabled()) {
         PinbaClient::me()->timerStart('memcached_' . $host . '_' . $port . '_connect', ['memcached_connect' => $host . '_' . $port]);
     }
     parent::__construct($host, $port, $buffer);
     if (PinbaClient::isEnabled()) {
         PinbaClient::me()->timerStop('memcached_' . $host . '_' . $port . '_connect');
     }
 }
Exemplo n.º 2
0
 public function queryRaw($queryString)
 {
     if (PinbaClient::isEnabled()) {
         $queryLabel = substr($queryString, 0, 5);
         PinbaClient::me()->timerStart('pg_sql_query_' . $this->basename, ['group' => 'sql', 'pg_sql_query' => $queryLabel, 'pg_sql_server' => $this->hostname, 'pg_sql_base' => $this->basename]);
     }
     try {
         $result = parent::queryRaw($queryString);
         if (PinbaClient::isEnabled()) {
             PinbaClient::me()->timerStop('pg_sql_query_' . $this->basename);
         }
         return $result;
     } catch (\Exception $e) {
         if (PinbaClient::isEnabled()) {
             PinbaClient::me()->timerStop('pg_sql_query_' . $this->basename);
         }
         throw $e;
     }
 }
Exemplo n.º 3
0
 private function stopLog($methodName)
 {
     if (PinbaClient::isEnabled()) {
         PinbaClient::me()->timerStop('pecl_memcached_' . $this->host . '_' . $this->port . '_' . $methodName);
     }
 }