(self)
return ret
Read power stats and return dictionary
Read power stats and return dictionary
Read power stats and return dictionary
def read_power(self):
        """ Read power stats and return dictionary"""

        pjoin = os.path.join
        ret = list()
        for path in self.basenames:
            name = None
            try:
                name = cat(pjoin(path, 'name'), fallback=None, binary=False)
            except (IOError, OSError, ValueError) as err:
                logging.warning("ignoring %r for file %r",
                                (err, path), RuntimeWarning)
                continue
            if name:
                try:
                    current = cat(pjoin(path, 'energy_uj'))
                    max_reading = 0.0
                    ret.append(RaplStats(name, float(current), max_reading))
                except (IOError, OSError, ValueError) as err:
                    logging.warning("ignoring %r for file %r",
                                    (err, path), RuntimeWarning)
        return ret
def read_power ( self ) : pjoin = os . path . join ret = list ( ) for path in self . basenames : name = None try : name = cat ( pjoin ( path , 'name' ) , fallback = None , binary = False ) except ( IOError , OSError , ValueError ) as err : logging . warning ( "ignoring %r for file %r" , ( err , path ) , RuntimeWarning ) continue if name : try : current = cat ( pjoin ( path , 'energy_uj' ) ) max_reading = 0.0 ret . append ( RaplStats ( name , float ( current ) , max_reading ) ) except ( IOError , OSError , ValueError ) as err : logging . warning ( "ignoring %r for file %r" , ( err , path ) , RuntimeWarning ) return ret