1111#define BOOST_TEST_MODULE Test Monitoring InfluxDB
1212#define BOOST_TEST_DYN_LINK
1313#include < boost/test/unit_test.hpp>
14- #include " ../src/UriParser/UriParser.h"
15- #include " ../src/Transports/UDP.h"
16- #include " ../src/Transports/StdOut.h"
17- #include " ../src/Backends/InfluxDB.h"
14+ #include " Monitoring/MonitoringFactory.h"
1815
1916namespace o2
2017{
@@ -25,20 +22,14 @@ namespace Test
2522
2623BOOST_AUTO_TEST_CASE (simplySendMetric)
2724{
28- std::string url = " influxdb-udp://localhost:1000" ;
29- auto parsed = http::ParseHttpUrl (url);
30- auto transport = std::make_unique<transports::UDP>(parsed.host , parsed.port );
31- o2::monitoring::backends::InfluxDB influxBackend (std::move (transport));
32- o2::monitoring::Metric metric{10 , " myCrazyMetric" };
33- influxBackend.send (metric);
25+ auto monitoring = MonitoringFactory::Get (" influxdb-udp://localhost:1000" );
26+ monitoring->send (Metric{10 , " myCrazyMetric" });
3427}
3528
3629BOOST_AUTO_TEST_CASE (simplySendMetric2)
3730{
38- auto transport = std::make_unique<transports::StdOut>();
39- o2::monitoring::backends::InfluxDB influxBackend (std::move (transport));
40- o2::monitoring::Metric metric{10 , " myCrazyMetric" };
41- influxBackend.send (metric);
31+ auto monitoring = MonitoringFactory::Get (" influxdb-stdout://" );
32+ monitoring->send (Metric{10 , " myCrazyMetric" });
4233}
4334
4435} // namespace Test
0 commit comments