Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Correct erroneous reported max lag with prometheus (#10427)
Co-authored-by: BuckarooBanzay <BuckarooBanzay@users.noreply.github.com>
  • Loading branch information
BuckarooBanzay and BuckarooBanzay committed Sep 25, 2020
1 parent 9bff154 commit c6e3050
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/server.cpp
Expand Up @@ -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
{
Expand Down

0 comments on commit c6e3050

Please sign in to comment.