mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-22 04:01:27 +00:00
feat: add disks usage
This commit is contained in:
parent
6357fb436c
commit
ebb88bf969
|
@ -44,4 +44,11 @@ class PrometheusQueries:
|
|||
return self._send_request(params=params)
|
||||
|
||||
@staticmethod
|
||||
def disks_usage(): ...
|
||||
def disk_usage() -> PrometheusInfo:
|
||||
"""Get disk usage information"""
|
||||
start = int((datetime.now() - timedelta(minutes=20)).timestamp())
|
||||
end = int(datetime.now().timestamp())
|
||||
query = 'rate(node_filesystem_size_bytes{mountpoint="/"}[5m])'
|
||||
|
||||
params = {"query": query, "start": start, "end": end, "step": 60}
|
||||
return self._send_request(params=params)
|
||||
|
|
Loading…
Reference in a new issue