Rework and improve the scheduling of the server lag check

Previously the server lag check was run by update_clock() if the number of
seconds since client startup was a multiple of 20 (unless it had already been
done this second).  This meant that if update_clock() was not being called
frequently (eg. if your IRC connection was very quiet), it might go a long
time between lag checks.

This commit adds a /set LAG_CHECK_INTERVAL (defaulting to 30).  For each
server, a lag check ping is scheduled for every LAG_CHECK_INTERVAL seconds
after the connection is finalised/registered.  Setting this value to 0
disables the lag check pings entirely.

The old code set the lag to 'unknown' immediately after sending out a ping,
which meant that it was quite unpredictable how long the lag value would
stay around for.  The new code only sets this once the current lag value
has become stale (ie. a ping reply is overdue based on the current lag
value).  If your lag is staying the same or reducing, you shouldn't see
the [Lag ??] at all.
This commit is contained in:
Kevin Easton
2015-06-12 15:54:43 +10:00
parent 7eae2aba86
commit 6dbc712046
8 changed files with 87 additions and 88 deletions

View File

@@ -1,5 +1,8 @@
[Changes 1.2.2]
* Rework the lag check to make it simpler and more reliable. This adds
a /set LAG_CHECK_INTERVAL to control the frequency of lag checks. (caf)
* Wire up /set DOUBLE_STATUS_LINE (reported by presi). (caf)
* Fix ignoring of nick changes. (caf)