Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Framework/src/RepositoryBenchmark.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void RepositoryBenchmark::InitTask()

// start a timer in a thread to send monitoring metrics, if needed
if (mThreadedMonitoring) {
mTimer = new boost::asio::deadline_timer(io, boost::posix_time::seconds(mThreadedMonitoringInterval));
mTimer = new boost::asio::system_timer(io, seconds(mThreadedMonitoringInterval));
mTimer->async_wait(boost::bind(&RepositoryBenchmark::checkTimedOut, this));
th = new thread([&] { io.run(); });
}
Expand All @@ -141,7 +141,7 @@ void RepositoryBenchmark::checkTimedOut()
mMonitoring->send({ mTotalNumberObjects, "ccdb_benchmark_objects_sent" }, DerivedMetricMode::RATE);

// restart timer
mTimer->expires_at(mTimer->expires_at() + boost::posix_time::seconds(mThreadedMonitoringInterval));
mTimer->expires_after(seconds(mThreadedMonitoringInterval));
mTimer->async_wait(boost::bind(&RepositoryBenchmark::checkTimedOut, this));
}

Expand Down
4 changes: 2 additions & 2 deletions Framework/src/RepositoryBenchmark.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <TH1.h>
#include <Monitoring/MonitoringFactory.h>
#include <boost/asio.hpp>
#include <boost/asio/deadline_timer.hpp>
#include <boost/asio/system_timer.hpp>
#include <thread>
#include <string>

Expand Down Expand Up @@ -64,7 +64,7 @@ class RepositoryBenchmark : public fair::mq::Device
// TH1* mMyHisto;

// variables for the timer
boost::asio::deadline_timer* mTimer; /// the asynchronous timer to send monitoring data
boost::asio::system_timer* mTimer; /// the asynchronous timer to send monitoring data
boost::asio::io_context io;
std::thread* th;
};
Expand Down
Loading