xrootd
XrdBwmLogger.hh
Go to the documentation of this file.
1 #ifndef __XRDBWMLOGGER_H__
2 #define __XRDBWMLOGGER_H__
3 /******************************************************************************/
4 /* */
5 /* X r d B w m L o g g e r . h h */
6 /* */
7 /* (c) 2008 by the Board of Trustees of the Leland Stanford, Jr., University */
8 /* All Rights Reserved */
9 /* Produced by Andrew Hanushevsky for Stanford University under contract */
10 /* DE-AC02-76-SFO0515 with the Department of Energy */
11 /******************************************************************************/
12 
13 // $Id$
14 
15 #include <strings.h>
16 #include "XrdSys/XrdSysPthread.hh"
17 
18 class XrdBwmLoggerMsg;
19 class XrdOucProg;
20 class XrdSysError;
21 
23 {
24 public:
25 
26 struct Info
27  {const char *Tident;
28  const char *Lfn;
29  const char *lclNode;
30  const char *rmtNode;
31  time_t ATime; // Arrival
32  time_t BTime; // Begin
33  time_t CTime; // Complete
34  int numqIn;
35  int numqOut;
36  int numqXeq;
37  long long Size;
38  int ESec;
39  char Flow; // I or O
40  };
41 
42 void Event(Info &eInfo);
43 
44 const char *Prog() {return theTarget;}
45 
46 void sendEvents(void);
47 
48 int Start(XrdSysError *eobj);
49 
50  XrdBwmLogger(const char *Target);
51  ~XrdBwmLogger();
52 
53 private:
54 int Feed(const char *data, int dlen);
56 void retMsg(XrdBwmLoggerMsg *tp);
57 
58 pthread_t tid;
59 char *theTarget;
68 int msgFD;
69 int endIT;
70 int msgsInQ;
71 static const int maxmInQ = 256;
72 char theEOL;
73 };
74 #endif