diff options
author | Buckaroo Banzai <39065740+BuckarooBanzay@users.noreply.github.com> | 2020-09-25 18:52:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-25 18:52:42 +0200 |
commit | c6e3050357e8378ad15e7fa7a9aa80f3936fbc2d (patch) | |
tree | 82d16da643461219a8249e53fb37429777aafd13 /src | |
parent | 9bff154cba14686f5a3b56f4cba405824b88c402 (diff) | |
download | minetest-c6e3050357e8378ad15e7fa7a9aa80f3936fbc2d.tar.gz minetest-c6e3050357e8378ad15e7fa7a9aa80f3936fbc2d.tar.bz2 minetest-c6e3050357e8378ad15e7fa7a9aa80f3936fbc2d.zip |
Correct erroneous reported max lag with prometheus (#10427)
Co-authored-by: BuckarooBanzay <BuckarooBanzay@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/server.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/server.cpp b/src/server.cpp index b8a99f6ae..456edfeb8 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -653,7 +653,12 @@ void Server::AsyncRunStep(bool initial_step) } m_clients.step(dtime); - m_lag_gauge->increment((m_lag_gauge->get() > dtime ? -1 : 1) * dtime/100); + // increase/decrease lag gauge gradually + if (m_lag_gauge->get() > dtime) { + m_lag_gauge->decrement(dtime/100); + } else { + m_lag_gauge->increment(dtime/100); + } #if USE_CURL // send masterserver announce { |