influxdbrouter.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:LMS 作者: RRZE-HPC 项目源码 文件源码
def __init__(self, config):
        """
        Read timeout and database configurations from config object
        """
        self.config = config
        self.buffer = {}
        self.addtimes = {}
        self.active_keys = []
        self.lock = Lock()


        self.timeout = 600
        if self.config.has_section("CacheConfig"):
            if self.config.has_option("CacheConfig", "timeout"):
                self.timeout = self.config.getint("CacheConfig", "timeout")

        self.oldest = None
        self.batch_ready = Queue()

        self.send_in_progress = False
        self.heads = {"Content-Type" : "application/octet-stream"}
        self.dbs = {}
        self.db_hosts = {}
        self.def_db_host = { "hostname" : "localhost",
                             "port" : 8086,
                             "username" : "testuser",
                             "password" : "testpass",
                             "maxsend" : 1000,
                             "batch" : 10,
                             "maxcache" : 2000,
                             "timeout" : 10,
                             "maxdbs" : 1000,
                             "activedbs" : [],
                             "exclude" : "",
                             "create_db" : False}

        self.read_db("AdminDB")
        if self.config.has_section("SplitConfig"):
            if self.config.has_option("SplitConfig", "dbentries"):
                l_dbentries = re.split("\s*,\s*", self.config.get("SplitConfig", "dbentries"))
                for db in l_dbentries:
                    splitdb = "SplitDB-%s" % db
                    self.read_db(splitdb)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号