(self, msg)
Sum stats together, to lessen load on logdb.
Sum stats together, to lessen load on logdb.
Sum stats together to lessen load on logdb .
def aggregate_stats(self, msg):
        """Sum stats together, to lessen load on logdb."""

        msg = msg[1:-1]
        for rec in msg.split(", "):
            k, v = rec.split(": ")
            agg = self.stat_cache.get(k, 0)
            if v.find('.') >= 0:
                agg += float(v)
            else:
                agg += int(v)
            self.stat_cache[k] = agg
def aggregate_stats ( self , msg ) : msg = msg [ 1 : - 1 ] for rec in msg . split ( ", " ) : k , v = rec . split ( ": " ) agg = self . stat_cache . get ( k , 0 ) if v . find ( '.' ) >= 0 : agg += float ( v ) else : agg += int ( v ) self . stat_cache [ k ] = agg