Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
gm-mysql-exporter
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
system
gm-mysql-exporter
Commits
ac817b8b
Commit
ac817b8b
authored
Apr 04, 2019
by
胡凯旋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
format MemoryUseRate
parent
d012edb4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
7 deletions
+4
-7
config.yaml.tpl
config.yaml.tpl
+1
-1
exporter.py
exporter.py
+3
-6
No files found.
config.yaml.tpl
View file @
ac817b8b
...
...
@@ -74,7 +74,7 @@ tencent_metrics:
# CPU利用率因子,CPU利用率*该因子得到一个较为统一的标准
factor: cpu_usage_factor
MemoryUse:
MemoryUse
Rate
:
name: rds_memory_usage_ratio
factor: memory_usage_factor
...
...
exporter.py
View file @
ac817b8b
...
...
@@ -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
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment