Belle II Software  release-05-02-19
RFFlowStat.h
1 #ifndef FLOWSTAT_H
2 #define FLOWSTAT_H
3 //+
4 // File : RFFlowStat.h
5 // Description : Calculate data flow statistics and put them in
6 // RfNodeInfo structure
7 //
8 // Author : Ryosuke Itoh, KEK
9 // Date : 21 - Aug - 2013
10 //-
11 
12 #include <sys/time.h>
13 
14 #include "framework/pcore/RingBuffer.h"
15 #include "daq/rfarm/manager/RFSharedMem.h"
16 #include "daq/rfarm/manager/RfNodeInfo.h"
17 
18 #define RF_INPUT_ID 51
19 #define RF_OUTPUT_ID 52
20 #define RF_ROI_ID 53
21 
22 namespace Belle2 {
28  class RFFlowStat {
29  public:
30  RFFlowStat(const char* shmname, int id, RingBuffer* rbuf); // Constructor for fillter
31  RFFlowStat(const char* shmname); // Constructor for retriever
32  ~RFFlowStat();
33 
34  // functions for filler
35  void log(int size);
36 
37  void clear(int id);
38 
39  // functions for retriever
40  RfShm_Cell& getinfo(int id);
41  void fillNodeInfo(int id, RfNodeInfo* info, bool inout);
42  void fillProcessStatus(RfNodeInfo* info, int pid_input = 0, int pid_output = 0,
43  int pid_basf2 = 0, int pid_hserver = 0, int pid_hrelay = 0);
44 
45  private:
46  RFSharedMem* m_rfshm;
47  RfShm_Cell* m_cell;
48  RingBuffer* m_rbuf;
49  float m_flowsize;
50  int m_nevtint;
51  int m_interval;
52  struct timeval m_t0;
53 
54  };
56 }
57 #endif
Belle2::RFFlowStat
Definition: RFFlowStat.h:28
Belle2::RFSharedMem
Definition: RFSharedMem.h:51
Belle2::RingBuffer
Class to manage a Ring Buffer placed in an IPC shared memory.
Definition: RingBuffer.h:36
Belle2::RfShm_Cell
Definition: RFSharedMem.h:27
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::RfNodeInfo
Definition: RfNodeInfo.h:17