You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
removed time.sleep and using ticker instead (#648)
* removed time.sleep and using ticker instead
Signed-off-by: Nir Rozenbaum <[email protected]>
* move ticker creation outside of go routine.
make sure refresh internal is valid at the ticker creation time
Signed-off-by: Nir Rozenbaum <[email protected]>
* add DefaultRefreshPrometheusMetricsInterval for test purposes.
once ticker was introduced instead of sleep, having 0 as the refresh internal is not valid.
Signed-off-by: Nir Rozenbaum <[email protected]>
* wait in test until metrics are available before running tests that rely on the values.
up until now, the metrics go routine ran in tests with time.Sleep(0), which means metrics were avaiable immediately.
while in tests in might be acceptable to wait few seconds using sleep, in the actual code (not tests) it's a bad practice to use
sleep which was replaced with a ticker (to perform periodic task in an endless loop).
Signed-off-by: Nir Rozenbaum <[email protected]>
---------
Signed-off-by: Nir Rozenbaum <[email protected]>
0 commit comments