mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 00:31:14 +00:00
Threads safe socket rate stats
This commit is contained in:
parent
3353e214a7
commit
31456e71ff
|
@ -16,6 +16,7 @@
|
|||
#define FAIRMQSOCKETNN_H_
|
||||
|
||||
#include <vector>
|
||||
#include <atomic>
|
||||
|
||||
#include "FairMQSocket.h"
|
||||
|
||||
|
@ -64,10 +65,10 @@ class FairMQSocketNN : public FairMQSocket
|
|||
private:
|
||||
int fSocket;
|
||||
std::string fId;
|
||||
unsigned long fBytesTx;
|
||||
unsigned long fBytesRx;
|
||||
unsigned long fMessagesTx;
|
||||
unsigned long fMessagesRx;
|
||||
std::atomic<unsigned long> fBytesTx;
|
||||
std::atomic<unsigned long> fBytesRx;
|
||||
std::atomic<unsigned long> fMessagesTx;
|
||||
std::atomic<unsigned long> fMessagesRx;
|
||||
};
|
||||
|
||||
#endif /* FAIRMQSOCKETNN_H_ */
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
#ifndef FAIRMQSOCKETZMQ_H_
|
||||
#define FAIRMQSOCKETZMQ_H_
|
||||
|
||||
#include <atomic>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#include "FairMQSocket.h"
|
||||
|
@ -65,10 +67,10 @@ class FairMQSocketZMQ : public FairMQSocket
|
|||
private:
|
||||
void* fSocket;
|
||||
std::string fId;
|
||||
unsigned long fBytesTx;
|
||||
unsigned long fBytesRx;
|
||||
unsigned long fMessagesTx;
|
||||
unsigned long fMessagesRx;
|
||||
std::atomic<unsigned long> fBytesTx;
|
||||
std::atomic<unsigned long> fBytesRx;
|
||||
std::atomic<unsigned long> fMessagesTx;
|
||||
std::atomic<unsigned long> fMessagesRx;
|
||||
|
||||
static boost::shared_ptr<FairMQContextZMQ> fContext;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user