/**
* @brief stop all pingers and remove them from Pingers variable which will
* proboably cause their destruction
- *
+ *
* Pingers is empty afterwards
*/
void PingScheduler::clear_pingers()
<< NPingers << " done with result " << to_string(edited_result);
// post-processing
- // can call update_ping_interval only after update_ping_statistics!
HostAnalyzer.update_ping_statistics( edited_result, ping_duration_us );
// prepare next ping only after all pingers are done
<< "--------------------------------------------------------------";
// update variables for next ping: number of pings, delay, protocol
+ // do this only after call to update_ping_statistics!
update_ping_protocol();
update_ping_interval();
update_ping_number();
GlobalLogger.debug() << LogPrefix << "- Speeding up ping interval to: "
<< PingIntervalInSec << "s";
- PingReplyTimeout = PingReplyTimeoutOrig * PingTimeoutFactor;
- GlobalLogger.debug() << LogPrefix << "- Increase ping timeout to "
- << PingReplyTimeout << "s";
}
else
{
GlobalLogger.debug() << LogPrefix << "- Stick to the original ping "
<< "interval: " << PingIntervalInSec << "s";
- PingReplyTimeout = PingReplyTimeoutOrig;
- GlobalLogger.debug() << LogPrefix << "- Reset ping timeout to "
- << PingReplyTimeout << "s";
}
}
/** in case of congested line, increase number of pings
*
+ * also increases ping timeout if line is congested
+ *
* CAUTION! Only call this after clear_pingers !!!
* */
void PingScheduler::update_ping_number()
{
NPingers.increase();
- GlobalLogger.notice() << LogPrefix << "Line appears congested!";
+ GlobalLogger.notice() << LogPrefix << "No reply from host, "
+ << "switching to burst ping mode with longer timeouts";
GlobalLogger.debug() << LogPrefix << "- Increasing ping number to: "
<< NPingers;
+
+ PingReplyTimeout = PingReplyTimeoutOrig * PingTimeoutFactor;
+ GlobalLogger.debug() << LogPrefix << "- Increase ping timeout to "
+ << PingReplyTimeout << "s";
}
else
{
GlobalLogger.debug() << LogPrefix << "- Stick to the original ping "
<< "number: " << NPingers;
+
+ PingReplyTimeout = PingReplyTimeoutOrig;
+ GlobalLogger.debug() << LogPrefix << "- Reset ping timeout to "
+ << PingReplyTimeout << "s";
}
+ // tell host analyzer so it expects the correct number of ping results
HostAnalyzer.set_n_parallel_pings(NPingers);
}