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
e0947312
Commit
e0947312
authored
Apr 15, 2019
by
胡凯旋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
4994f8e8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
exporter.py
exporter.py
+6
-5
No files found.
exporter.py
View file @
e0947312
...
@@ -37,7 +37,8 @@ class TencentExporter(Exporter):
...
@@ -37,7 +37,8 @@ class TencentExporter(Exporter):
data_from_tencent
[
label
]
=
[]
data_from_tencent
[
label
]
=
[]
# 一次批量取 batch_size 个实例的监控数据
# 一次批量取 batch_size 个实例的监控数据
batch_size
=
20
batch_size
=
20
for
i
in
range
(
0
,
int
(
math
.
ceil
(
len
(
instance_id_list
)
/
batch_size
))):
page
=
int
(
math
.
ceil
(
len
(
instance_id_list
)
/
batch_size
))
for
i
in
range
(
page
+
1
):
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
:
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
)
...
@@ -155,9 +156,9 @@ class AliyunExporter(Exporter):
...
@@ -155,9 +156,9 @@ class AliyunExporter(Exporter):
return
metrics_to_export
return
metrics_to_export
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
#
tencent_exporter = TencentExporter()
tencent_exporter
=
TencentExporter
()
#
data = tencent_exporter.export_prometheus_data()
data
=
tencent_exporter
.
export_prometheus_data
()
# # print(data)
# # print(data)
aliyun_exporter
=
AliyunExporter
()
#
aliyun_exporter = AliyunExporter()
data
=
aliyun_exporter
.
_fetch_monitor_data
()
#
data = aliyun_exporter._fetch_monitor_data()
# print(data)
# print(data)
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