Skip to content

Commit c6e3050

Browse files
authoredSep 25, 2020
Correct erroneous reported max lag with prometheus (#10427)
Co-authored-by: BuckarooBanzay <BuckarooBanzay@users.noreply.github.com>
1 parent 9bff154 commit c6e3050

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

‎src/server.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,12 @@ void Server::AsyncRunStep(bool initial_step)
653653
}
654654
m_clients.step(dtime);
655655

656-
m_lag_gauge->increment((m_lag_gauge->get() > dtime ? -1 : 1) * dtime/100);
656+
// increase/decrease lag gauge gradually
657+
if (m_lag_gauge->get() > dtime) {
658+
m_lag_gauge->decrement(dtime/100);
659+
} else {
660+
m_lag_gauge->increment(dtime/100);
661+
}
657662
#if USE_CURL
658663
// send masterserver announce
659664
{

0 commit comments

Comments
 (0)
Please sign in to comment.