Skip to content

Commit 6396fc4

Browse files
committed
publish sleep
1 parent ea5ee56 commit 6396fc4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/ConsumerStats.cxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,9 @@ class ConsumerStats : public Consumer
215215

216216
counterBytesDiff = 0;
217217
counterBlocksDiff = 0;
218+
219+
// ensure a minimum time between consecutive publish
220+
usleep(10000);
218221
}
219222

220223
// run a function in a separate thread to publish data regularly, until flag isShutdown is set
@@ -236,8 +239,6 @@ class ConsumerStats : public Consumer
236239
if (timeUntilTimeout <= 0) {
237240
publishStats();
238241
monitoringUpdateTimer.increment(true);
239-
// ensure a minimum time between consecutive publish
240-
usleep(100000);
241242
} else {
242243
if (timeUntilTimeout > 1) {
243244
timeUntilTimeout = 1.0; // avoid a sleep longer than 1s to allow exiting promptly

0 commit comments

Comments
 (0)