summaryrefslogtreecommitdiff
path: root/src/PeerStorage.h
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-10-25 23:33:45 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-10-25 23:33:45 +0900
commit0ecfa19925453e3e4bf8ca947dc72a597654e401 (patch)
tree09e2a91ca926e58489bee5c4ba2ae3ba2ba102de /src/PeerStorage.h
parent46bdaf0e8dae04d223d9b8b65ac80bc0773d8398 (diff)
Reworked download/upload statistics calculation
The old implementation calculates download/upload statistics for a RequestGroup by summing up all PeerStat objects. For global statistics, those are summed together. This clearly incurs runtime penalty and we introduced some kind of caching which updates statistics every 250ms but it did not work right. This change removes all these aggregation code, and instead makes RequestGroup and RequestGroupMan objects hold NetStat object and download/upload bytes are directly calculated by thier own NetStat. This is far more simplar than the old way and less runtime penalty and brings more accuracy.
Diffstat (limited to 'src/PeerStorage.h')
-rw-r--r--src/PeerStorage.h9
1 files changed, 0 insertions, 9 deletions
diff --git a/src/PeerStorage.h b/src/PeerStorage.h
index 57d3b1ac..ab4cb2e2 100644
--- a/src/PeerStorage.h
+++ b/src/PeerStorage.h
@@ -95,15 +95,6 @@ public:
virtual void getActivePeers(std::vector<SharedHandle<Peer> >& peers) = 0;
/**
- * Calculates current download/upload statistics.
- */
- virtual TransferStat calculateStat() = 0;
-
- virtual void updateTransferStatFor(const SharedHandle<Peer>& peer) = 0;
-
- virtual TransferStat getTransferStatFor(const SharedHandle<Peer>& peer) = 0;
-
- /**
* Returns true if peer with ipaddr should be ignored because, for
* example, it sends bad data.
*/