'This method will ssh to the SGE master and get load & queue stats. It
will feed these stats to SGEStats, which parses the XML. It will return
two arrays: one of hosts, each host has a hash with its host
information inside. The job array contains a hash for every job,
containing statistics about the job name, priority, etc.'

@utils.print_timing('Fetching    SGE    stats', debug=True)
def get_stats(self):

    log.debug('starting    get_stats')
    retries = 5
    for i in range(retries):
        try:
            return self._get_stats()
        except Exception:
            log.warn(('Failed    to    retrieve    stats    (%d/%d):' % ((i + 1), retries)), exc_info=True)
            log.warn(('Retrying    in    %ds' % self.polling_interval))
            time.sleep(self.polling_interval)
    raise exception.BaseException(('Failed    to    retrieve    SGE    stats    after    trying    %d    times,    exiting...' % retries))
