(self)
return string
Return string containing the receiver stats
Return string containing the receiver stats
Return string containing the receiver stats
def __str__(self):
        """Return string containing the receiver stats"""
        if (self.utc):
            timestamp = time.gmtime()
        else:
            timestamp = time.localtime()
        t_now = time.strftime("%Y-%m-%d %H:%M:%S", timestamp)

        string = "{} ".format(t_now)

        for key in self._metrics.keys():
            if key in self.stats:
                val = self.stats[key]
                # Label=Value
                string += " {} = {:{fmt_str}}".format(
                    self._metrics[key]['label'],
                    val[0],
                    fmt_str=self._metrics[key]['format_str'],
                )
                # Unit
                if (not math.isnan(val[0]) and val[1]):
                    string += val[1]

                string += ";"

        return string
def __str__ ( self ) : if ( self . utc ) : timestamp = time . gmtime ( ) else : timestamp = time . localtime ( ) t_now = time . strftime ( "%Y-%m-%d %H:%M:%S" , timestamp ) string = "{} " . format ( t_now ) for key in self . _metrics . keys ( ) : if key in self . stats : val = self . stats [ key ] # Label=Value string += " {} = {:{fmt_str}}" . format ( self . _metrics [ key ] [ 'label' ] , val [ 0 ] , fmt_str = self . _metrics [ key ] [ 'format_str' ] , ) # Unit if ( not math . isnan ( val [ 0 ] ) and val [ 1 ] ) : string += val [ 1 ] string += ";" return string