BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
IOStats.h
1 #pragma once
2 
3 #include <string>
4 
5 #include <Poco/RWLock.h>
6 
7 namespace BeeeOn {
8 
15 class IOStats {
16 public:
17  struct Data {
18  uint64_t writtenPdu;
19  uint64_t writtenBytes;
20  uint64_t readPdu;
21  uint64_t readBytes;
22  uint64_t lostPdu;
23  uint64_t lostBytes;
24 
25  std::string toString() const;
26  };
27 
28  IOStats();
29 
35  void written(size_t bytes);
36 
42  void read(size_t bytes);
43 
50  void lost(size_t bytes);
51 
55  Data data() const;
56 
57 private:
58  Data m_data;
59  mutable Poco::RWLock m_lock;
60 };
61 
62 }
void lost(size_t bytes)
Notify that the given amount of bytes representing a single PDU have been lost because of too low pro...
void written(size_t bytes)
Notify that the given amount of bytes have been written to an output device as a single PDU...
Definition: IOStats.h:17
void read(size_t bytes)
Notify that the given amount of bytes have been read from an input device as a single PDU...
IOStats represents common I/O statistics that are usually measured for performance monitoring...
Definition: IOStats.h:15
Data data() const