Commit b272e69b authored by Azat Khuziyakhmetov's avatar Azat Khuziyakhmetov
Browse files

fixes in fetching nodes' info

parent 07c57cda
......@@ -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():
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