Commit ac817b8b authored by 胡凯旋's avatar 胡凯旋

format MemoryUseRate

parent d012edb4
......@@ -74,7 +74,7 @@ tencent_metrics:
# CPU利用率因子,CPU利用率*该因子得到一个较为统一的标准
factor: cpu_usage_factor
MemoryUse:
MemoryUseRate:
name: rds_memory_usage_ratio
factor: memory_usage_factor
......
......@@ -85,13 +85,10 @@ class TencentExporter(Exporter):
""" inplace change data
"""
for label, instance_data_list in data.items():
# 腾讯云CPU利用率返回的是0-100(%), 转化成 0-1
if label == "CPUUseRate":
for instance in instance_data_list:
for instance in instance_data_list:
# 腾讯云CPU利用率/内存使用率返回的是0-100(%), 转化成 0-1
if label in ["CPUUseRate", "MemoryUseRate"]:
instance['Values'][:] = map(lambda v: v/100, instance['Values'])
# 腾讯云返回的是内存使用率,通过除以配置中记录的实例的总内存得到内存使用率
elif label == "MemoryUse":
pass
class AliyunExporter(Exporter):
......
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