Ejemplo n.º 1
0
 private function _getFastFillingPercentage($mode)
 {
     if ($mode == 'saving') {
         // mode saving
         if (is_null($this->_fastBackendFillingPercentage)) {
             $this->_fastBackendFillingPercentage = $this->_fastBackend->getFillingPercentage();
         } else {
             $rand = rand(1, $this->_options['stats_update_factor']);
             if ($rand == 1) {
                 // we force a refresh
                 $this->_fastBackendFillingPercentage = $this->_fastBackend->getFillingPercentage();
             }
         }
     } else {
         // mode loading
         // we compute the percentage only if it's not available in cache
         if (is_null($this->_fastBackendFillingPercentage)) {
             $this->_fastBackendFillingPercentage = $this->_fastBackend->getFillingPercentage();
         }
     }
     return $this->_fastBackendFillingPercentage;
 }
 /**
  * Return the filling percentage of the backend storage
  *
  * @return int integer between 0 and 100
  */
 public function getFillingPercentage()
 {
     return $this->_backend->getFillingPercentage();
 }