From fcffb426296793f4a352029019ccac1aeb900dbf Mon Sep 17 00:00:00 2001 From: lakshyacis Date: Tue, 10 Sep 2019 20:00:42 +0530 Subject: [PATCH] stats pylint fixes --- src/network/stats.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/network/stats.py b/src/network/stats.py index a1f66425..fedfbbc1 100644 --- a/src/network/stats.py +++ b/src/network/stats.py @@ -1,3 +1,7 @@ +""" +src/network/stats.py +==================== +""" import time import asyncore_pollchoose as asyncore @@ -14,6 +18,7 @@ currentSentSpeed = 0 def connectedHostsList(): + """List of all the connected hosts""" retval = [] for i in BMConnectionPool().inboundConnections.values() + \ BMConnectionPool().outboundConnections.values(): @@ -27,10 +32,13 @@ def connectedHostsList(): def sentBytes(): + """Sending Bytes""" return asyncore.sentBytes def uploadSpeed(): + """Getting upload speed""" + # pylint: disable=global-statement global lastSentTimestamp, lastSentBytes, currentSentSpeed currentTimestamp = time.time() if int(lastSentTimestamp) < int(currentTimestamp): @@ -42,10 +50,13 @@ def uploadSpeed(): def receivedBytes(): + """Receiving Bytes""" return asyncore.receivedBytes def downloadSpeed(): + """Getting download speed""" + # pylint: disable=global-statement global lastReceivedTimestamp, lastReceivedBytes, currentReceivedSpeed currentTimestamp = time.time() if int(lastReceivedTimestamp) < int(currentTimestamp): @@ -58,6 +69,7 @@ def downloadSpeed(): def pendingDownload(): + """Getting pending downloads""" return len(missingObjects) # tmp = {} # for connection in BMConnectionPool().inboundConnections.values() + \ @@ -68,6 +80,7 @@ def pendingDownload(): def pendingUpload(): + """Getting pending uploads""" # tmp = {} # for connection in BMConnectionPool().inboundConnections.values() + \ # BMConnectionPool().outboundConnections.values():