added performance warnings for when the IP overhead eats up the entire up- or download rate limit

This commit is contained in:
Arvid Norberg 2008-10-28 06:45:42 +00:00
parent e9dd8ce050
commit 7fd2fd4732
3 changed files with 21 additions and 1 deletions

View File

@ -4368,6 +4368,8 @@ upload or download rate performance.
{
outstanding_disk_buffer_limit_reached,
outstanding_request_limit_reached,
upload_limit_too_low,
download_limit_too_low
};
performance_warning_t warning_code;

View File

@ -158,7 +158,9 @@ namespace libtorrent
enum performance_warning_t
{
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
@ -177,6 +179,8 @@ namespace libtorrent
{
"max outstanding disk writes 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: "

View File

@ -1104,11 +1104,25 @@ namespace aux {
+ m_stat.download_dht()
+ 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_stat.upload_ip_overhead()
+ m_stat.upload_dht()
+ 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);
// --------------------------------------------------------------