XrdBwmLogger.hh

Go to the documentation of this file.
00001 #ifndef __XRDBWMLOGGER_H__
00002 #define __XRDBWMLOGGER_H__
00003 /******************************************************************************/
00004 /*                                                                            */
00005 /*                       X r d B w m L o g g e r . h h                        */
00006 /*                                                                            */
00007 /* (c) 2008 by the Board of Trustees of the Leland Stanford, Jr., University  */
00008 /*                            All Rights Reserved                             */
00009 /*   Produced by Andrew Hanushevsky for Stanford University under contract    */
00010 /*              DE-AC02-76-SFO0515 with the Department of Energy              */
00011 /******************************************************************************/
00012   
00013 //         $Id: XrdBwmLogger.hh 24468 2008-06-22 16:47:03Z ganis $
00014 
00015 #include <strings.h>
00016 #include "XrdSys/XrdSysPthread.hh"
00017 
00018 class XrdBwmLoggerMsg;
00019 class XrdOucProg;
00020 class XrdSysError;
00021   
00022 class XrdBwmLogger
00023 {
00024 public:
00025 
00026 struct Info
00027       {const char   *Tident;
00028        const char   *Lfn;
00029        const char   *lclNode;
00030        const char   *rmtNode;
00031              time_t  ATime;    // Arrival
00032              time_t  BTime;    // Begin
00033              time_t  CTime;    // Complete
00034              int     numqIn;
00035              int     numqOut;
00036              int     numqXeq;
00037         long long    Size;
00038              int     ESec;
00039              char    Flow;     // I or O
00040       };
00041 
00042 void        Event(Info &eInfo);
00043 
00044 const char *Prog() {return theTarget;}
00045 
00046 void        sendEvents(void);
00047 
00048 int         Start(XrdSysError *eobj);
00049 
00050       XrdBwmLogger(const char *Target);
00051      ~XrdBwmLogger();
00052 
00053 private:
00054 int              Feed(const char *data, int dlen);
00055 XrdBwmLoggerMsg *getMsg();
00056 void             retMsg(XrdBwmLoggerMsg *tp);
00057 
00058 pthread_t          tid;
00059 char              *theTarget;
00060 XrdSysError       *eDest;
00061 XrdOucProg        *theProg;
00062 XrdSysMutex        qMut;
00063 XrdSysSemaphore    qSem;
00064 XrdBwmLoggerMsg   *msgFirst;
00065 XrdBwmLoggerMsg   *msgLast;
00066 XrdSysMutex        fMut;
00067 XrdBwmLoggerMsg   *msgFree;
00068 int                msgFD;
00069 int                endIT;
00070 int                msgsInQ;
00071 static const int   maxmInQ = 256;
00072 char               theEOL;
00073 };
00074 #endif

Generated on Tue Jul 5 14:46:16 2011 for ROOT_528-00b_version by  doxygen 1.5.1