Example #1
0
 public function getApproximateLagStatus()
 {
     if ($this->lagDetectionMethod === 'pt-heartbeat') {
         // Disable caching since this is fast enough and we don't wan't
         // to be *too* pessimistic by having both the cache TTL and the
         // pt-heartbeat interval count as lag in getSessionLagStatus()
         return parent::getApproximateLagStatus();
     }
     $key = wfGlobalCacheKey('mysql-lag', $this->getServer());
     $approxLag = $this->srvCache->get($key);
     if (!$approxLag) {
         $approxLag = parent::getApproximateLagStatus();
         $this->srvCache->set($key, $approxLag, 1);
     }
     return $approxLag;
 }