From: umherirrender Date: Sun, 21 Aug 2016 15:01:04 +0000 (+0200) Subject: Floor slave lag before display X-Git-Tag: 1.31.0-rc.0~5844^2 X-Git-Url: https://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_user_edit%27%2C%20iduser=user.userid%29%20%7D%7D?a=commitdiff_plain;h=99cbd7d54b669136bc14df44c638c0d7ae78bdde;p=lhc%2Fweb%2Fwiklou.git Floor slave lag before display Seeing slave lags like 15.309758901596 looks scary Change-Id: Ie564670448311364b8492af6b82943312118dc29 --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index eb3040cd28..74ade3e60c 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2547,6 +2547,7 @@ class OutputPage extends ContextSource { public function showLagWarning( $lag ) { $config = $this->getConfig(); if ( $lag >= $config->get( 'SlaveLagWarning' ) ) { + $lag = floor( $lag ); // floor to avoid nano seconds to display $message = $lag < $config->get( 'SlaveLagCritical' ) ? 'lag-warn-normal' : 'lag-warn-high';