Monitoring  3.3.4
O2 Monitoring library
Unix.h
Go to the documentation of this file.
1 // Copyright CERN and copyright holders of ALICE O2. This software is
2 // distributed under the terms of the GNU General Public License v3 (GPL
3 // Version 3), copied verbatim in the file "COPYING".
4 //
5 // See http://alice-o2.web.cern.ch/license for full licensing information.
6 //
7 // In applying this license CERN does not waive the privileges and immunities
8 // granted to it by virtue of its status as an Intergovernmental Organization
9 // or submit itself to any jurisdiction.
10 
15 
16 #ifndef ALICEO2_MONITORING_TRANSPORTS_UNIX_H
17 #define ALICEO2_MONITORING_TRANSPORTS_UNIX_H
18 
19 #include "TransportInterface.h"
20 
21 #include <boost/array.hpp>
22 #include <boost/asio.hpp>
23 #include <boost/algorithm/string.hpp>
24 #include <chrono>
25 #include <string>
26 
27 namespace o2
28 {
30 namespace monitoring
31 {
33 namespace transports
34 {
35 
37 class Unix : public TransportInterface
38 {
39  public:
42  Unix(const std::string& socketPath);
43 
45  ~Unix() = default;
46 
48  void send(std::string&& message) override;
49 
50  private:
52  boost::asio::io_service mIoService;
53 #if defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
54  boost::asio::local::datagram_protocol::socket mSocket;
56 
58  boost::asio::local::datagram_protocol::endpoint mEndpoint;
59 #endif // defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
60 };
61 
62 } // namespace transports
63 } // namespace monitoring
64 } // namespace o2
65 
66 #endif // ALICEO2_MONITORING_TRANSPORTS_UNIX_H
Unix(const std::string &socketPath)
~Unix()=default
Default destructor.
Definition: Backend.h:23
Transport interface for backends.
Definition: TransportInterface.h:31
Transport that sends string formatted metrics via Unix datagram socket.
Definition: Unix.h:37
void send(std::string &&message) override