From fbfd02b08b37d71a312b907058eb81515857a3e6 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Fri, 22 Oct 2021 03:00:14 -0300 Subject: [PATCH] add analytics event for network disk space --- lbry/blob/disk_space_manager.py | 5 +++-- lbry/extras/daemon/analytics.py | 3 ++- lbry/wallet/__init__.pyc | Bin 1268 -> 0 bytes 3 files changed, 5 insertions(+), 3 deletions(-) delete mode 100644 lbry/wallet/__init__.pyc diff --git a/lbry/blob/disk_space_manager.py b/lbry/blob/disk_space_manager.py index 3ce813064..1156b3e16 100644 --- a/lbry/blob/disk_space_manager.py +++ b/lbry/blob/disk_space_manager.py @@ -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 = [] diff --git a/lbry/extras/daemon/analytics.py b/lbry/extras/daemon/analytics.py index 868b14789..3db911bb7 100644 --- a/lbry/extras/daemon/analytics.py +++ b/lbry/extras/daemon/analytics.py @@ -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 }) ) diff --git a/lbry/wallet/__init__.pyc b/lbry/wallet/__init__.pyc deleted file mode 100644 index d4854844fe6b60a10a9b0972d81a6424f412ff41..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1268 zcmZ8g+in{-5IyomzRI`wQahJAP9OB*RRaVGPy|JrIDmsVPC^MN%9q7@$x1}XU4cv4 zaeuOZ(I3cjfzFUh>_o)Qa?ad#&WvV1cb5PC=fAwf^fyEA-{@)30u&%gwjf(jGmtY- zvyih;bC7dT^H6QrdAK%Y8*Tw|0d5g;5pD@`2`%CFfYp_Rfk02kBzK(u(gO~`5BkUm9O)j#sc0CR8*BC6>%X+uRY|})nO>d06o0-SUCw$d z%iE%&BtF3lWINa4s`ejm3ZH334l!iPr$OzaC=mmg2H8IHoMOI?MOh%^6Q zmi43xVU6!fdEGSA>S2kXzNv;*ztPuWpR`k>ec{WIDGPg|gZ9o;hDa&9vt$iCuz@eC zrYM7{tH{v1Nf=K;m?zWgif&!r`mjnOS^A|n;}AomJ?Y7d^YuTRnV{dAPo|37aZ-fh zf<}A8&8aSw_RV?sC(g|5=6O{sovT8-y2|rdZHmzzeG6Qe?>r{nk_S&T&ztdOS_49O z+-Wrgw;;GMwG&aGm5vbDG1RG-l8^~mdmRWG0(Z5K;5KNEYPY^s7 z!97KW!VS5C$0{~iY_XYZHjztlhrw+IxsI9=CUzL+y^Ox2$eP$Ay-Uw6(J;pUr(SBe qm*+I)kmuR>I%a(CYBjO?S6