add analytics event for network disk space

This commit is contained in:
Victor Shyba 2021-10-22 03:00:14 -03:00 committed by Jack Robison
parent b39c26fc86
commit fbfd02b08b
3 changed files with 5 additions and 3 deletions

View file

@ -32,8 +32,9 @@ class DiskSpaceManager:
else:
storage_limit = self.config.blob_storage_limit*1024*1024 if self.config.blob_storage_limit else None
if self.analytics:
# todo: add metrics for network case
asyncio.create_task(self.analytics.send_disk_space_used(space_used_bytes, storage_limit))
asyncio.create_task(
self.analytics.send_disk_space_used(space_used_bytes, storage_limit, from_network_storage)
)
if not storage_limit:
return 0
delete = []

View file

@ -170,11 +170,12 @@ class AnalyticsManager:
})
)
async def send_disk_space_used(self, storage_used, storage_limit):
async def send_disk_space_used(self, storage_used, storage_limit, is_from_network_quota):
await self.track(
self._event(DISK_SPACE, {
'used': storage_used,
'limit': storage_limit,
'from_network_quota': is_from_network_quota
})
)

Binary file not shown.