Get the stats for the current :class:`Milestone`
321582
def stats(self):
        
        response = self.requester.get(
            '/{endpoint}/{id}/stats',
            endpoint=self.endpoint, id=self.id
        )
        return response.json()
254139
def get_daemon_stats(self, details=False):
        
        # Call the base Daemon one
        res = super(Broker, self).get_daemon_stats(details=details)

        res.update({'name': self.name, 'type': self.type})

        counters = res['counters']
        counters['broks-external'] = len(self.external_broks)
        counters['broks-internal'] = len(self.internal_broks)
        counters['broks-arbiter'] = len(self.arbiter_broks)
        counters['satellites.pollers'] = len(self.pollers)
        counters['satellites.reactionners'] = len(self.reactionners)
        counters['satellites.receivers'] = len(self.receivers)

        return res
873680
def get_stats_action(cachespec, interval):
    
    if cachespec == 'global':
        caches = get_bcache_fs()
    else:
        caches = [Bcache.fromdevice(cachespec)]
    res = dict((c.cachepath, c.get_stats(interval)) for c in caches)
    return json.dumps(res, indent=4, separators=(',', ': '))
380147
def _get_progress(self):
        
        input_data = []
        ret = {}

        # traverse emerge.log from bottom up to get latest information
        last_lines = self.py3.command_output(["tail", "-50", self.emerge_log_file])
        input_data = last_lines.split("\n")
        input_data.reverse()

        for line in input_data:
            if "*** terminating." in line:
                # copy content of ret_default, not only the references
                ret = copy.deepcopy(self.ret_default)
                break
            else:
                status_re = re.compile(
                    "\((?P<cu>[\d]+) of (?P<t>[\d]+)\) "
                    "(?P<a>[a-zA-Z\/]+( [a-zA-Z]+)?) "
                    "\((?P<ca>[\w\-]+)\/(?P<p>[\w\.]+)"
                )
                res = status_re.search(line)
                if res is not None:
                    ret["action"] = res.group("a").lower()
                    ret["category"] = res.group("ca")
                    ret["current"] = res.group("cu")
                    ret["pkg"] = res.group("p")
                    ret["total"] = res.group("t")
                    break
        return ret
433936
def get_daemon_stats(self, details=False):
        
        # call the daemon one
        res = super(BaseSatellite, self).get_daemon_stats(details=details)

        counters = res['counters']
        counters['external-commands'] = len(self.external_commands)
        counters['satellites.arbiters'] = len(self.arbiters)
        counters['satellites.schedulers'] = len(self.schedulers)

        return res
530473
def stats(self):
        
        # TODO - this would be nicer if we formatted the stats
        return self._client.get('{}/stats'.format(Instance.api_endpoint), model=self)
124170
public static synchronized ExecutionStatistics get()
    {
        Thread currentThread = Thread.currentThread();
        if (stats.get(currentThread) == null)
        {
            stats.put(currentThread, new ExecutionStatistics());
        }
        return stats.get(currentThread);
    }
1326119
def calculate_stats(self, data):
        
        timestamp = data['timestamp']
        del data['timestamp']

        # Iterate through the last poll results
        stats = self.consumer_stats_counter()
        consumer_stats = dict()
        for name in data.keys():
            consumer_stats[name] = self.consumer_stats_counter()
            consumer_stats[name]['processes'] = self.process_count(name)
            for proc in data[name].keys():
                for key in stats:
                    value = data[name][proc]['counts'].get(key, 0)
                    stats[key] += value
                    consumer_stats[name][key] += value

        # Return a data structure that can be used in reporting out the stats
        stats['processes'] = len(self.active_processes())
        return {
            'last_poll': timestamp,
            'consumers': consumer_stats,
            'process_data': data,
            'counts': stats
        }
243818
def stats(self):
        
        status, _, body = self._request('GET', self.stats_path(),
                                        {'Accept': 'application/json'})
        if status == 200:
            return json.loads(bytes_to_str(body))
        else:
            return None
288354
def milestones(self, extra_params=None):
        
        
        # Default params
        params = {
            'per_page': settings.MAX_PER_PAGE,
        }

        if extra_params:
            params.update(extra_params)
            
        return self.api._get_json(
            Milestone,
            space=self,
            rel_path=self._build_rel_path('milestones/all'),
            extra_params=params,
            get_all=True,  # Retrieve all milestones in the space
        )
618943
def validate_milestones(self):
        '''
        
        '''
        milestones = self.arc_root_node.get_children().filter(arc_element_type__contains='mile')
        current_cursor = 0
        for mile in milestones:
            seq = mile.milestone_seq
            if seq < current_cursor:
                return mile
            current_cursor = seq
        return None
116907
def get(self, nb=0):
        """"""
        return {i: self.stats_history[i].history_raw(nb=nb) for i in self.stats_history}
1064347
def get_progress(self):
        

        count_remaining = len(self.items_queued) + len(self.items_in_progress)
        percentage_remaining = 100 / self.count_total * count_remaining

        return 100 - percentage_remaining
743589
def __display_stats(self):
        """"""

        self.display('unify.tmpl', processed=self.total,
                     matched=self.matched,
                     unified=self.total - self.matched)
1275730
def lstat(self):
        
        if self._closed:
            self._raise_closed()
        return self._accessor.lstat(self)
726132
def stats(self, name, value):
        
        counter = self.get(name, CounterType.Statistics)
        self._calculate_stats(counter, value)
        self._update()
748296
public function milestones($args = null)
    {
        $this->areArgumentsValid($args, ['getProgress']);

        return $this->client->get("$this->endpoint/$this->id/milestones", $args)->response();
    }