DRYing the code by using \OCA\files\lib\Helper::buildFileStorageStatistics() now returning used space percent on each ajax call
logic to call it every 5 minutes make use of visibility API/jquery-visibility to perform the ajax call only if the browser is visible/in use