Commit 4994f8e8 authored by 胡凯旋's avatar 胡凯旋

batch size 20

parent 8b6dfbf3
...@@ -34,14 +34,12 @@ class TencentExporter(Exporter): ...@@ -34,14 +34,12 @@ class TencentExporter(Exporter):
instance_id_list = self.instances.keys() instance_id_list = self.instances.keys()
# 遍历所有指标 # 遍历所有指标
for label in self.metrics.keys(): for label in self.metrics.keys():
print('-------------')
data_from_tencent[label] = [] data_from_tencent[label] = []
# 一次批量取 batch_size 个实例的监控数据 # 一次批量取 batch_size 个实例的监控数据
batch_size = 10 batch_size = 20
for i in range(0, int(math.ceil(len(instance_id_list)/batch_size))): for i in range(0, int(math.ceil(len(instance_id_list)/batch_size))):
instance_to_get = instance_id_list[batch_size*i : batch_size*(i+1)] instance_to_get = instance_id_list[batch_size*i : batch_size*(i+1)]
try: try:
print('(((((((())))))))))')
res = self.monitor.get_cdb_metric(instance_to_get, label, self.data_interval) res = self.monitor.get_cdb_metric(instance_to_get, label, self.data_interval)
# print(res) # print(res)
data_from_tencent[label].extend(res['DataPoints']) data_from_tencent[label].extend(res['DataPoints'])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment