From 4453a7a994c1f64ab5074de1164ff245ff5c82fc Mon Sep 17 00:00:00 2001 From: Avan Date: Wed, 22 Jun 2022 20:30:06 +0530 Subject: [PATCH] Revert "exporter: set stats_period to 0 on first response" --- src/cephadm/tox.ini | 2 +- src/exporter/DaemonMetricCollector.cc | 5 +++-- src/pybind/mgr/tox.ini | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/cephadm/tox.ini b/src/cephadm/tox.ini index d41b440a6810a..095bced7a74fe 100644 --- a/src/cephadm/tox.ini +++ b/src/cephadm/tox.ini @@ -62,6 +62,6 @@ deps = flake8-quotes commands = flake8 --config=tox.ini {posargs:cephadm} - bash -c "test $(grep 'docker.io' cephadm | wc -l) == 12" + bash -c "test $(grep 'docker.io' cephadm | wc -l) == 11" # Downstream distributions may choose to alter this "docker.io" number, # to make sure no new references to docker.io are creeping in unnoticed. diff --git a/src/exporter/DaemonMetricCollector.cc b/src/exporter/DaemonMetricCollector.cc index 21d0efa3e08d9..c9961c9507839 100644 --- a/src/exporter/DaemonMetricCollector.cc +++ b/src/exporter/DaemonMetricCollector.cc @@ -22,15 +22,16 @@ void DaemonMetricCollector::request_loop(boost::asio::steady_timer &timer) { update_sockets(); dump_asok_metrics(); auto stats_period = g_conf().get_val("exporter_stats_period"); - // time to wait before sending requests again timer.expires_from_now(std::chrono::seconds(stats_period)); request_loop(timer); }); } void DaemonMetricCollector::main() { + // time to wait before sending requests again + auto stats_period = g_conf().get_val("exporter_stats_period"); boost::asio::io_service io; - boost::asio::steady_timer timer{io, std::chrono::seconds(0)}; + boost::asio::steady_timer timer{io, std::chrono::seconds(stats_period)}; request_loop(timer); io.run(); } diff --git a/src/pybind/mgr/tox.ini b/src/pybind/mgr/tox.ini index 6f3164bbe522f..a0c3aec2331b7 100644 --- a/src/pybind/mgr/tox.ini +++ b/src/pybind/mgr/tox.ini @@ -183,7 +183,7 @@ modules = commands = flake8 --config=tox.ini {posargs} \ {posargs:{[testenv:flake8]modules}} - bash -c 'test $(git ls-files cephadm | grep ".py$" | grep -v tests | xargs grep "docker.io" | wc -l) == 14' + bash -c 'test $(git ls-files cephadm | grep ".py$" | grep -v tests | xargs grep "docker.io" | wc -l) == 16' [testenv:jinjalint] basepython = python3 -- 2.39.5