Пример #1
0
 def gather(self):
     container_nodes = self.get_container_nodes()
     res_type = 'memory'
     for container_node in container_nodes:
         state_op = StateOpers(container_node.container_name)
         memory = state_op.get_memory_stat_item()
         node_name = self.con_op.get_container_node_from_container_name(
             container_node.cluster_name, container_node.container_name)
         memory.update({
             'cluster_name': container_node.cluster_name,
             'node_name': node_name
         })
         self.write_to_es(res_type, memory)
Пример #2
0
 def test_get_memory_stat_item(self):
     stateOpers = StateOpers('d-mcl-mcluster-manager-test-n-3')
     result = stateOpers.get_memory_stat_item()
     print "get_memory_stat_item: %s" % result