mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-10 17:35:00 -06:00
Collect and save alltime UL/DL samples
Conflicts: src/qtlibtorrent/torrentspeedmonitor.cpp
This commit is contained in:
committed by
sledgehammer999
parent
454cd4c120
commit
d74e96f65f
@@ -49,26 +49,30 @@ public:
|
||||
explicit TorrentSpeedMonitor(QBtSession* session);
|
||||
~TorrentSpeedMonitor();
|
||||
qlonglong getETA(const QString &hash) const;
|
||||
quint64 getAlltimeDL() const;
|
||||
quint64 getAlltimeUL() const;
|
||||
|
||||
protected:
|
||||
void run();
|
||||
|
||||
private:
|
||||
void getSamples();
|
||||
void saveStats() const;
|
||||
void loadStats();
|
||||
|
||||
private slots:
|
||||
void removeSamples(const QString& hash);
|
||||
void removeSamples(const QTorrentHandle& h);
|
||||
|
||||
private:
|
||||
static const int sampling_interval = 1000; // 1s
|
||||
|
||||
private:
|
||||
bool m_abort;
|
||||
QWaitCondition m_abortCond;
|
||||
QHash<QString, SpeedSample> m_samples;
|
||||
mutable QMutex m_mutex;
|
||||
QBtSession *m_session;
|
||||
// Will overflow at 15.9 EiB
|
||||
quint64 alltimeUL;
|
||||
quint64 alltimeDL;
|
||||
};
|
||||
|
||||
#endif // TORRENTSPEEDMONITOR_H
|
||||
|
||||
Reference in New Issue
Block a user