示例#1
0
    def update_database(self, nodes):
        online_nodes = dict(
            filter(lambda d: d[1]['flags']['online'], nodes.items()))
        client_count = sum(
            map(lambda d: d['statistics']['clients'], online_nodes.values()))

        self.globalDb.update(len(online_nodes), client_count)
        for node_id, node in online_nodes.items():
            rrd = NodeRRD(os.path.join(self.dbPath, node_id + '.rrd'), node)
            rrd.update()
示例#2
0
    def update_database(self, nodes):
        online_nodes = dict(filter(
            lambda d: d[1]['flags']['online'], nodes.items()))
        client_count = sum(map(
            lambda d: d['statistics']['clients'], online_nodes.values()))

        self.globalDb.update(len(online_nodes), client_count)
        for node_id, node in online_nodes.items():
            rrd = NodeRRD(os.path.join(self.dbPath, node_id + '.rrd'), node)
            rrd.update()
示例#3
0
    def update_images(self):
        self.globalDb.graph(os.path.join(self.imagePath, "globalGraph.png"),
                            self.displayTimeGlobal)

        nodedb_files = os.listdir(self.dbPath)

        for file_name in nodedb_files:
            if not os.path.isfile(os.path.join(self.dbPath, file_name)):
                continue

            node_name = os.path.basename(file_name).split('.')
            if node_name[1] == 'rrd' and not node_name[0] == "nodes":
                rrd = NodeRRD(os.path.join(self.dbPath, file_name))
                rrd.graph(self.imagePath, self.displayTimeNode)
示例#4
0
    def update_images(self):
        self.globalDb.graph(os.path.join(self.imagePath, "globalGraph.png"),
                            self.displayTimeGlobal)

        nodedb_files = os.listdir(self.dbPath)

        for file_name in nodedb_files:
            if not os.path.isfile(os.path.join(self.dbPath, file_name)):
                continue

            node_name = os.path.basename(file_name).split('.')
            if node_name[1] == 'rrd' and not node_name[0] == "nodes":
                rrd = NodeRRD(os.path.join(self.dbPath, file_name))
                rrd.graph(self.imagePath, self.displayTimeNode)