def rrd(cnx, payload, msg): now = time() if not msg["type"] in last_seen: last_seen[msg["type"]] = now if now - last_seen[msg["type"]] >= 1: write_rrd(rrd_l[msg["type"]], cfg, msg["type"], payload) last_seen[msg["type"]] = now
def rrd(cnx, ev): if last_seen.get(ev["_type"], ev["_when"] ) != ev["_when"]: write_rrd(open_rrd(cfg, ev["_type"]), cfg, ev["_type"], ev) last_seen[ev["_type"]] = ev["_when"]
def rrd(cnx, ev, serialization = "simplejson"): if last_seen.get(ev["_type"], ev["_when"] ) != ev["_when"]: write_rrd(rrd_l[ev["_type"]], cfg, ev["_type"], ev) last_seen[ev["_type"]] = ev["_when"]