class UpdateCacheProtocol(DummyCacheProtocol): """Like the dummy, but actually updates""" def __init__(self): self.api = RRDBasicAPI() def do_FLUSH(self, line): self.sendLine("0 Success") def do_PENDING(self, line): self.sendLine("0 Success") def do_UPDATE(self, line): line = line.split() assert len(line) == 3 path = line[1] args = line[2].split(':') timestamp = args.pop(0) log.msg("SERVER UPDATING: %s" % path) self.api.update(path, timestamp, args) self.sendLine("0 Success")
def __init__(self): self.api = RRDBasicAPI()