mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-25 21:41:27 +00:00
fix: zero offsets
This commit is contained in:
parent
60ce3b773d
commit
ab4920dd3a
|
@ -263,6 +263,9 @@ class MonitoringQueries:
|
||||||
|
|
||||||
offset, duration = MonitoringQueries._calculate_offset_and_duration(start, end)
|
offset, duration = MonitoringQueries._calculate_offset_and_duration(start, end)
|
||||||
|
|
||||||
|
if offset == 0:
|
||||||
|
query = f'max_over_time(container_memory_rss{{id!~".*slice.*slice", id=~".*slice"}}[{duration}s])'
|
||||||
|
else:
|
||||||
query = f'max_over_time(container_memory_rss{{id!~".*slice.*slice", id=~".*slice"}}[{duration}s] offset {offset}s)'
|
query = f'max_over_time(container_memory_rss{{id!~".*slice.*slice", id=~".*slice"}}[{duration}s] offset {offset}s)'
|
||||||
|
|
||||||
data = MonitoringQueries._send_query(query, result_type="vector")
|
data = MonitoringQueries._send_query(query, result_type="vector")
|
||||||
|
@ -299,6 +302,9 @@ class MonitoringQueries:
|
||||||
|
|
||||||
offset, duration = MonitoringQueries._calculate_offset_and_duration(start, end)
|
offset, duration = MonitoringQueries._calculate_offset_and_duration(start, end)
|
||||||
|
|
||||||
|
if offset == 0:
|
||||||
|
query = f'avg_over_time(container_memory_rss{{id!~".*slice.*slice", id=~".*slice"}}[{duration}s])'
|
||||||
|
else:
|
||||||
query = f'avg_over_time(container_memory_rss{{id!~".*slice.*slice", id=~".*slice"}}[{duration}s] offset {offset}s)'
|
query = f'avg_over_time(container_memory_rss{{id!~".*slice.*slice", id=~".*slice"}}[{duration}s] offset {offset}s)'
|
||||||
|
|
||||||
data = MonitoringQueries._send_query(query, result_type="vector")
|
data = MonitoringQueries._send_query(query, result_type="vector")
|
||||||
|
|
Loading…
Reference in a new issue