]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert "exporter: set stats_period to 0 on first response" revert-46758-fix-stats-period-on-first-response
authorAvan <avanjohn@gmail.com>
Wed, 22 Jun 2022 15:00:06 +0000 (20:30 +0530)
committerGitHub <noreply@github.com>
Wed, 22 Jun 2022 15:00:06 +0000 (20:30 +0530)
src/cephadm/tox.ini
src/exporter/DaemonMetricCollector.cc
src/pybind/mgr/tox.ini

index d41b440a6810a201816bf3299d6638f9b2225009..095bced7a74feb165908d9d70d86b261e6593992 100644 (file)
@@ -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.
index 21d0efa3e08d97f1d47b22410c2caceffd55536d..c9961c9507839ee4c2f831720b765acbdd975eaf 100644 (file)
@@ -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<int64_t>("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<int64_t>("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();
 }
index 6f3164bbe522f6eb66a12f83b2dc24f2509c1f0a..a0c3aec2331b7dadd2ff27dfcb225556e8ef629d 100644 (file)
@@ -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