Пример #1
0
    def get(self, filter={}):
        _yappi._pause()
        self.clear()
        try:
            _yappi.enum_func_stats(self._enumerator, filter)

            # convert the children info from tuple to YChildFuncStat
            for stat in self:

                _childs = YChildFuncStats()
                for child_tpl in stat.children:
                    rstat = self[child_tpl[0]]

                    # sometimes even the profile results does not contain the result because of filtering
                    # or timing(call_leave called but call_enter is not), with this we ensure that the children
                    # index always point to a valid stat.
                    if rstat is None:
                        continue

                    tavg = rstat.ttot / rstat.ncall
                    cfstat = YChildFuncStat(child_tpl + (
                        tavg,
                        rstat.builtin,
                        rstat.full_name,
                        rstat.module,
                        rstat.lineno,
                        rstat.name,
                    ))
                    _childs.append(cfstat)
                stat.children = _childs
            result = super(YFuncStats, self).get()
        finally:
            _yappi._resume()
        return result
Пример #2
0
    def get(self):
        _yappi._pause()
        self.clear()
        try:
            _yappi.enum_func_stats(self._enumerator)

            # convert the children info from tuple to YChildFuncStat
            for stat in self:
                _childs = YChildFuncStats()
                for child_tpl in stat.children:
                    rstat = self[child_tpl[0]]

                    # sometimes even the profile results does not contain the result because of filtering
                    # or timing(call_leave called but call_enter is not), with this we ensure that the children
                    # index always point to a valid stat.
                    if rstat is None:
                        continue

                    tavg = rstat.ttot / rstat.ncall
                    cfstat = YChildFuncStat(child_tpl+(tavg, rstat.builtin, rstat.full_name, rstat.module,
                        rstat.lineno, rstat.name,))
                    _childs.append(cfstat)
                stat.children = _childs
            result = super(YFuncStats, self).get()
        finally:
            _yappi._resume()
        return result
Пример #3
0
    def get(self):
        _yappi.enum_func_stats(self._enumerator)

        # convert the children info from tuple to YChildFuncStat
        for stat in self._stats:
            _childs = []
            for child_tpl in stat.children:
                rstat = self.find_by_index(child_tpl[0])

                # sometimes even the profile results does not contain the result because of filtering
                # or timing(call_leave called but call_enter is not), with this we ensure that the children
                # index always point to a valid stat.
                if rstat is None:
                    continue

                cfstat = YChildFuncStat(child_tpl + (rstat.full_name, ))
                _childs.append(cfstat)
            stat.children = _childs

        return super(YFuncStats, self).get()
Пример #4
0
 def get(self):
     _yappi.enum_func_stats(self._enumerator)
     
     # convert the children info from tuple to YChildFuncStat
     for stat in self._stats:
         _childs = []
         for child_tpl in stat.children:
             rstat = self.find_by_index(child_tpl[0])
             
             # sometimes even the profile results does not contain the result because of filtering 
             # or timing(call_leave called but call_enter is not), with this we ensure that the children
             # index always point to a valid stat.
             if rstat is None:
                 continue 
                 
             cfstat = YChildFuncStat(child_tpl+(rstat.full_name,))
             _childs.append(cfstat)
         stat.children = _childs
     
     return super(YFuncStats, self).get()