/** * Return the filling percentage of the backend storage * * @return int integer between 0 and 100 */ public function getFillingPercentage() { $result = $this->_database->execute('db.stats()'); $total = @$result['retval']['storageSize'] ?: 0; $free = $total - @$result['retval']['dataSize'] ?: 0; if ($total == 0) { Zend_Cache::throwException('can\'t get disk_total_space'); } else { if ($free >= $total) { return 100; } return (int) (100.0 * ($total - $free) / $total); } }