mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-29 07:21:27 +00:00
fix: paste new query
This commit is contained in:
parent
ebb88bf969
commit
852cc28c1a
|
@ -6,7 +6,6 @@ from selfprivacy_api.utils.prometheus import PrometheusQueries
|
||||||
|
|
||||||
@strawberry.type
|
@strawberry.type
|
||||||
class Monitoring:
|
class Monitoring:
|
||||||
|
|
||||||
@strawberry.field
|
@strawberry.field
|
||||||
def disks_usage():
|
def disks_usage():
|
||||||
return PrometheusQueries.disks_usage()
|
return PrometheusQueries.disks_usage()
|
||||||
|
|
|
@ -48,7 +48,7 @@ class PrometheusQueries:
|
||||||
"""Get disk usage information"""
|
"""Get disk usage information"""
|
||||||
start = int((datetime.now() - timedelta(minutes=20)).timestamp())
|
start = int((datetime.now() - timedelta(minutes=20)).timestamp())
|
||||||
end = int(datetime.now().timestamp())
|
end = int(datetime.now().timestamp())
|
||||||
query = 'rate(node_filesystem_size_bytes{mountpoint="/"}[5m])'
|
query = '100 - (100 * ((node_filesystem_avail_bytes{mountpoint="/",fstype!="rootfs"} ) / (node_filesystem_size_bytes{mountpoint="/",fstype!="rootfs"}) ))'
|
||||||
|
|
||||||
params = {"query": query, "start": start, "end": end, "step": 60}
|
params = {"query": query, "start": start, "end": end, "step": 60}
|
||||||
return self._send_request(params=params)
|
return self._send_request(params=params)
|
||||||
|
|
Loading…
Reference in a new issue