Skip to content

Commit

Permalink
remove unused analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
jackrobison committed Jun 22, 2020
1 parent 8e851b4 commit f7958dd
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 37 deletions.
23 changes: 0 additions & 23 deletions lbry/extras/daemon/analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,8 @@
SERVER_STARTUP = 'Server Startup'
SERVER_STARTUP_SUCCESS = 'Server Startup Success'
SERVER_STARTUP_ERROR = 'Server Startup Error'
DOWNLOAD_STARTED = 'Download Started'
DOWNLOAD_ERRORED = 'Download Errored'
DOWNLOAD_FINISHED = 'Download Finished'
HEARTBEAT = 'Heartbeat'
CLAIM_ACTION = 'Claim Action' # publish/create/update/abandon
NEW_CHANNEL = 'New Channel'
CREDITS_SENT = 'Credits Sent'
UPNP_SETUP = "UPnP Setup"

BLOB_BYTES_UPLOADED = 'Blob Bytes Uploaded'


TIME_TO_FIRST_BYTES = "Time To First Bytes"


Expand Down Expand Up @@ -133,7 +123,6 @@ async def run(self):
while True:
if self.enabled:
self.external_ip = await utils.get_external_ip()
await self._send_heartbeat()
await asyncio.sleep(1800)

def stop(self):
Expand Down Expand Up @@ -211,18 +200,6 @@ async def send_download_finished(self, download_id, name, sd_hash):
)
)

async def send_claim_action(self, action):
await self.track(self._event(CLAIM_ACTION, {'action': action}))

async def send_new_channel(self):
await self.track(self._event(NEW_CHANNEL))

async def send_credits_sent(self):
await self.track(self._event(CREDITS_SENT))

async def _send_heartbeat(self):
await self.track(self._event(HEARTBEAT))

def _event(self, event, properties: typing.Optional[typing.Dict] = None):
return {
'userId': 'lbry',
Expand Down
12 changes: 0 additions & 12 deletions lbry/extras/daemon/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -1501,7 +1501,6 @@ async def jsonrpc_wallet_send(

if not preview:
await self.ledger.broadcast(tx)
self.component_manager.loop.create_task(self.analytics_manager.send_credits_sent())
else:
await self.ledger.release_tx(tx)

Expand Down Expand Up @@ -2574,7 +2573,6 @@ async def jsonrpc_channel_create(
self.component_manager.loop.create_task(self.storage.save_claims([self._old_get_temp_claim_info(
tx, txo, claim_address, claim, name, dewies_to_lbc(amount)
)]))
self.component_manager.loop.create_task(self.analytics_manager.send_new_channel())
else:
await account.ledger.release_tx(tx)

Expand Down Expand Up @@ -2730,7 +2728,6 @@ async def jsonrpc_channel_update(
self.component_manager.loop.create_task(self.storage.save_claims([self._old_get_temp_claim_info(
tx, new_txo, claim_address, new_txo.claim, new_txo.claim_name, dewies_to_lbc(amount)
)]))
self.component_manager.loop.create_task(self.analytics_manager.send_new_channel())
else:
await account.ledger.release_tx(tx)

Expand Down Expand Up @@ -2789,7 +2786,6 @@ async def jsonrpc_channel_abandon(

if not preview:
await self.broadcast_or_release(tx, blocking)
self.component_manager.loop.create_task(self.analytics_manager.send_claim_action('abandon'))
else:
await account.ledger.release_tx(tx)

Expand Down Expand Up @@ -3110,7 +3106,6 @@ async def jsonrpc_stream_repost(self, name, bid, claim_id, allow_duplicate_name=

if not preview:
await self.broadcast_or_release(tx, blocking)
self.component_manager.loop.create_task(self.analytics_manager.send_claim_action('publish'))
else:
await account.ledger.release_tx(tx)

Expand Down Expand Up @@ -3272,7 +3267,6 @@ async def save_claims():
await self.storage.save_content_claim(file_stream.stream_hash, new_txo.id)

self.component_manager.loop.create_task(save_claims())
self.component_manager.loop.create_task(self.analytics_manager.send_claim_action('publish'))
else:
await account.ledger.release_tx(tx)

Expand Down Expand Up @@ -3495,7 +3489,6 @@ async def save_claims():
await self.storage.save_content_claim(stream_hash, new_txo.id)

self.component_manager.loop.create_task(save_claims())
self.component_manager.loop.create_task(self.analytics_manager.send_claim_action('publish'))
else:
await account.ledger.release_tx(tx)

Expand Down Expand Up @@ -3554,7 +3547,6 @@ async def jsonrpc_stream_abandon(

if not preview:
await self.broadcast_or_release(tx, blocking)
self.component_manager.loop.create_task(self.analytics_manager.send_claim_action('abandon'))
else:
await self.ledger.release_tx(tx)

Expand Down Expand Up @@ -3719,7 +3711,6 @@ async def jsonrpc_collection_create(

if not preview:
await self.broadcast_or_release(tx, blocking)
self.component_manager.loop.create_task(self.analytics_manager.send_claim_action('publish'))
else:
await account.ledger.release_tx(tx)

Expand Down Expand Up @@ -3873,7 +3864,6 @@ async def jsonrpc_collection_update(

if not preview:
await self.broadcast_or_release(tx, blocking)
self.component_manager.loop.create_task(self.analytics_manager.send_claim_action('publish'))
else:
await account.ledger.release_tx(tx)

Expand Down Expand Up @@ -4039,7 +4029,6 @@ async def jsonrpc_support_create(
'claim_id': claim_id,
'amount': dewies_to_lbc(amount)
}]})
self.component_manager.loop.create_task(self.analytics_manager.send_claim_action('new_support'))
else:
await self.ledger.release_tx(tx)

Expand Down Expand Up @@ -4156,7 +4145,6 @@ async def jsonrpc_support_abandon(

if not preview:
await self.broadcast_or_release(tx, blocking)
self.component_manager.loop.create_task(self.analytics_manager.send_claim_action('abandon'))
else:
await self.ledger.release_tx(tx)

Expand Down
2 changes: 0 additions & 2 deletions lbry/wallet/usage_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ async def pay(self):
)

await self.ledger.broadcast(tx)
if self.analytics_manager:
await self.analytics_manager.send_credits_sent()
self._on_payment_controller.add(tx)

async def start(self, ledger=None, wallet=None):
Expand Down

0 comments on commit f7958dd

Please sign in to comment.