Skip to content

Commit

Permalink
volume used and percentage metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
Koos85 committed Mar 26, 2024
1 parent a9729ec commit 002422d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions lib/check/volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,11 @@ async def check_volume(
check_config: dict):

state = await get_data(asset, asset_config, check_config, QUERIES)
for vol in state.get('volumeEntry', []):
free = vol['volumeFreeSpace']
total = vol['volumeSize']
vol['volumeUsedSpace'] = used = total - free
vol['volumeUsedPercentage'] = 100 * used / total if total else None
vol['volumeFreePercentage'] = 100 * free / total if total else None

return state
2 changes: 1 addition & 1 deletion lib/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Version string. Examples:
# '3.0.0'
# '3.0.0-alpha9'
__version__ = '3.0.0-alpha2'
__version__ = '3.0.0-alpha3'

0 comments on commit 002422d

Please sign in to comment.