mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-22 04:01:27 +00:00
fix: Take swap into account when counting service RAM usage metrics
This commit is contained in:
parent
bd2fae2e6d
commit
806c3052ff
|
@ -281,9 +281,9 @@ class MonitoringQueries:
|
|||
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])'
|
||||
query = f'max_over_time((container_memory_rss{{id!~".*slice.*slice", id=~".*slice"}}+container_memory_swap{{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"}}+container_memory_swap{{id!~".*slice.*slice", id=~".*slice"}})[{duration}s:] offset {offset}s)'
|
||||
|
||||
data = MonitoringQueries._send_query(query, result_type="vector")
|
||||
|
||||
|
@ -320,9 +320,9 @@ class MonitoringQueries:
|
|||
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])'
|
||||
query = f'avg_over_time((container_memory_rss{{id!~".*slice.*slice", id=~".*slice"}}+container_memory_swap{{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"}}+container_memory_swap{{id!~".*slice.*slice", id=~".*slice"}})[{duration}s:] offset {offset}s)'
|
||||
|
||||
data = MonitoringQueries._send_query(query, result_type="vector")
|
||||
|
||||
|
|
Loading…
Reference in a new issue