forked from premiere/premiere-libtorrent
added performance warnings for when the IP overhead eats up the entire up- or download rate limit
This commit is contained in:
parent
e9dd8ce050
commit
7fd2fd4732
|
@ -4368,6 +4368,8 @@ upload or download rate performance.
|
||||||
{
|
{
|
||||||
outstanding_disk_buffer_limit_reached,
|
outstanding_disk_buffer_limit_reached,
|
||||||
outstanding_request_limit_reached,
|
outstanding_request_limit_reached,
|
||||||
|
upload_limit_too_low,
|
||||||
|
download_limit_too_low
|
||||||
};
|
};
|
||||||
|
|
||||||
performance_warning_t warning_code;
|
performance_warning_t warning_code;
|
||||||
|
|
|
@ -158,7 +158,9 @@ namespace libtorrent
|
||||||
enum performance_warning_t
|
enum performance_warning_t
|
||||||
{
|
{
|
||||||
outstanding_disk_buffer_limit_reached,
|
outstanding_disk_buffer_limit_reached,
|
||||||
outstanding_request_limit_reached
|
outstanding_request_limit_reached,
|
||||||
|
upload_limit_too_low,
|
||||||
|
download_limit_too_low
|
||||||
};
|
};
|
||||||
|
|
||||||
performance_alert(torrent_handle const& h
|
performance_alert(torrent_handle const& h
|
||||||
|
@ -177,6 +179,8 @@ namespace libtorrent
|
||||||
{
|
{
|
||||||
"max outstanding disk writes reached",
|
"max outstanding disk writes reached",
|
||||||
"max outstanding piece requests reached",
|
"max outstanding piece requests reached",
|
||||||
|
"upload limit too low (download rate will suffer)",
|
||||||
|
"download limit too low (upload rate will suffer)"
|
||||||
};
|
};
|
||||||
|
|
||||||
return torrent_alert::message() + ": performance warning: "
|
return torrent_alert::message() + ": performance warning: "
|
||||||
|
|
|
@ -1104,11 +1104,25 @@ namespace aux {
|
||||||
+ m_stat.download_dht()
|
+ m_stat.download_dht()
|
||||||
+ m_stat.download_tracker());
|
+ m_stat.download_tracker());
|
||||||
|
|
||||||
|
if (m_stat.download_ip_overhead() >= m_download_channel.throttle()
|
||||||
|
&& m_alerts.should_post<performance_alert>())
|
||||||
|
{
|
||||||
|
m_alerts.post_alert(performance_alert(torrent_handle()
|
||||||
|
, performance_alert::download_limit_too_low));
|
||||||
|
}
|
||||||
|
|
||||||
m_upload_channel.drain(
|
m_upload_channel.drain(
|
||||||
m_stat.upload_ip_overhead()
|
m_stat.upload_ip_overhead()
|
||||||
+ m_stat.upload_dht()
|
+ m_stat.upload_dht()
|
||||||
+ m_stat.upload_tracker());
|
+ m_stat.upload_tracker());
|
||||||
|
|
||||||
|
if (m_stat.upload_ip_overhead() >= m_upload_channel.throttle()
|
||||||
|
&& m_alerts.should_post<performance_alert>())
|
||||||
|
{
|
||||||
|
m_alerts.post_alert(performance_alert(torrent_handle()
|
||||||
|
, performance_alert::upload_limit_too_low));
|
||||||
|
}
|
||||||
|
|
||||||
m_stat.second_tick(tick_interval);
|
m_stat.second_tick(tick_interval);
|
||||||
|
|
||||||
// --------------------------------------------------------------
|
// --------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue