Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ProfiT-HPC
aggregator
Commits
b272e69b
Commit
b272e69b
authored
Feb 24, 2020
by
Azat Khuziyakhmetov
Browse files
fixes in fetching nodes' info
parent
07c57cda
Changes
1
Show whitespace changes
Inline
Side-by-side
db/influx/influxdb_fetchnode.py
View file @
b272e69b
...
...
@@ -8,12 +8,13 @@ from . import metrics
m_node
=
conf
.
measurements
[
"node"
]
def
get_nodeinfo_query
(
node_id
):
def
get_nodeinfo_query
(
node_id
,
t_start
,
t_end
):
random_field
=
metrics
.
metrics_node
[
"sockets"
][
"dbname"
]
query
=
(
'SELECT last({:s}), * FROM "{:s}" '
'WHERE "host" =
\'
{:s}
\'
GROUP BY "host";'
).
format
(
random_field
,
m_node
,
node_id
)
'WHERE time >= {:d}s AND time <= {:d}s AND '
'"host" =
\'
{:s}
\'
GROUP BY "host";'
).
format
(
random_field
,
m_node
,
t_start
,
t_end
,
node_id
)
return
query
def
get_query_max_of_node
(
node_id
,
msrmnt
,
metric
,
metric_db
,
t_start
,
t_end
):
...
...
@@ -38,7 +39,7 @@ def get_node_queries(nodes, t_start, t_end):
queries
=
""
for
n
in
nodes
:
q
=
get_nodeinfo_query
(
n
)
q
=
get_nodeinfo_query
(
n
,
t_start
,
t_end
)
queries
+=
q
for
m
,
par
in
metrics
.
metrics_node
.
items
():
...
...
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