#include <XrdStats.hh>
|
| XrdStats (XrdSysError *eP, XrdScheduler *sP, XrdBuffManager *bP, const char *hn, int port, const char *in, const char *pn, const char *sn) |
|
virtual | ~XrdStats () |
|
void | Report (char **Dest=0, int iVal=600, int Opts=0) |
|
virtual void | Stats (CallBack *InfoBack, int opts) |
|
Definition at line 51 of file XrdStats.hh.
◆ XrdStats()
Definition at line 80 of file XrdStats.cc.
83{
84 static const char *head =
85 "<statistics tod=\"%%ld\" ver=\"" XrdVERSION "\" src=\"%s:%d\" "
86 "tos=\"%ld\" pgm=\"%s\" ins=\"%s\" pid=\"%d\" "
87 "site=\"%s\">";
88 char myBuff[1024];
89
90 XrdLog = eP;
91 XrdSched = sP;
92 BuffPool = bP;
93
94 Hlen = sprintf(myBuff, head, hname, port, tBoot, pname, iname,
95 static_cast<int>(getpid()), (site ? site : ""));
96 Head = strdup(myBuff);
97 buff = 0;
98 blen = 0;
99 myHost = hname;
100 myName = iname;
101 myPort = port;
102}
◆ ~XrdStats()
virtual XrdStats::~XrdStats |
( |
| ) |
|
|
inlinevirtual |
Definition at line 70 of file XrdStats.hh.
70{if (buff) free(buff);}
◆ Report()
void XrdStats::Report |
( |
char ** | Dest = 0, |
|
|
int | iVal = 600, |
|
|
int | Opts = 0 ) |
Definition at line 108 of file XrdStats.cc.
109{
110 static XrdNetMsg *netDest[2] = {0,0};
111 static int autoSync, repOpts =
Opts;
112 const char *Data;
113 int theOpts, Dlen;
114
115
116
117 if (Dest)
118
119
120 {if (Dest[0]) netDest[0] = new XrdNetMsg(XrdLog, Dest[0]);
121 if (Dest[1]) netDest[1] = new XrdNetMsg(XrdLog, Dest[1]);
124
125
126
127 if (netDest[0]) new XrdStatsJob(XrdSched, this, iVal);
128 return;
129 }
130
131
132
133 if (!autoSync || XrdSched->Active() <= 30) theOpts = repOpts;
134 else theOpts = repOpts & ~XRD_STATS_SYNC;
135
136
137
138 statsMutex.Lock();
139 if ((Data = GenStats(Dlen, theOpts)))
140 {netDest[0]->
Send(Data, Dlen);
141 if (netDest[1]) netDest[1]->
Send(Data, Dlen);
142 }
143 statsMutex.UnLock();
144}
int Send(const char *buff, int blen=0, const char *dest=0, int tmo=-1)
References XrdNetMsg::Send(), XRD_STATS_ALL, XRD_STATS_SYNC, and XRD_STATS_SYNCA.
◆ Stats()
Definition at line 150 of file XrdStats.cc.
151{
152 const char *info;
153 int sz;
154
155
156
157 statsMutex.Lock();
158
159
160
161 if ((info = GenStats(sz,
opts))) cbP->
Info(info, sz);
162
163
164
165 statsMutex.UnLock();
166}
virtual void Info(const char *data, int dlen)=0
References XrdStats::CallBack::Info(), and opts.
The documentation for this class was generated from the following files: