61 char *XrdXrootdMonFile::repBuff = 0;
64 char *XrdXrootdMonFile::repNext = 0;
65 char *XrdXrootdMonFile::repFirst = 0;
66 char *XrdXrootdMonFile::repLast = 0;
67 int XrdXrootdMonFile::totRecs = 0;
68 int XrdXrootdMonFile::xfrRecs = 0;
69 int XrdXrootdMonFile::repSize = 0;
70 int XrdXrootdMonFile::repTime = 0;
71 int XrdXrootdMonFile::fmHWM =-1;
72 int XrdXrootdMonFile::crecSize = 0;
73 int XrdXrootdMonFile::xfrCnt = 0;
74 int XrdXrootdMonFile::fBsz = 65472;
75 int XrdXrootdMonFile::xfrRem = 0;
77 short XrdXrootdMonFile::crecNLen = 0;
78 short XrdXrootdMonFile::trecNLen = 0;
79 char XrdXrootdMonFile::fsLFN = 0;
80 char XrdXrootdMonFile::fsLVL = 0;
81 char XrdXrootdMonFile::fsOPS = 0;
82 char XrdXrootdMonFile::fsSSQ = 0;
83 char XrdXrootdMonFile::fsXFR = 0;
84 char XrdXrootdMonFile::crecFlag = 0;
94 int iEnt, iMap, iSlot;
99 {iEnt = fsP->
MonEnt & 0xffff;
104 if (fmMap[iMap].Free(iSlot)) fmUse[iMap]--;
105 if (iMap == fmHWM)
while(fmHWM >= 0 && !fmUse[fmHWM]) fmHWM--;
169 cP = GetSlot(crecSize);
170 memcpy(cP, &cRec, crecSize);
186 fBsz = (fbsz <= 0 ? 65472 : fbsz);
221 dP->
Hdr.userID = usrID;
235 if (!xfrRem) DoXFR();
240 if (repNext) Flush();
252 void XrdXrootdMonFile::DoXFR()
270 for (i = 0; i <= hwm; i++)
275 while((fsP = fmMap[i].Next(n)))
276 {
if (fsP->
xfrXeq) DoXFR(fsP);
292 long long xfrRead, xfrReadv, xfrWrite;
308 xfrRec.
Xfr.
read = htonll(xfrRead);
309 xfrRec.
Xfr.
readv = htonll(xfrReadv);
310 xfrRec.
Xfr.
write = htonll(xfrWrite);
314 cP = GetSlot(
sizeof(xfrRec));
315 memcpy(cP, &xfrRec,
sizeof(xfrRec));
327 int alignment, pagsz = getpagesize();
331 alignment = (fBsz < pagsz ? 1024 : pagsz);
332 if (posix_memalign((
void **)&repBuff, alignment, fBsz))
358 repLast = repBuff+fBsz-1;
372 crecNLen = htons(
static_cast<short>(crecSize));
378 xfrRec.
Hdr.
recSize = htons(
static_cast<short>(
sizeof(xfrRec)));
398 void XrdXrootdMonFile::Flush()
405 repHdr->
pseq =
static_cast<char>(0x00ff & seq++);
409 repTOD->
Hdr.nRecs[0] = htons(
static_cast<short>(xfrRecs));
410 repTOD->
Hdr.nRecs[1] = htons(
static_cast<short>(totRecs));
411 repTOD->
tEnd = htonl(
static_cast<int>(time(0)));
415 bfSize = (repNext - repBuff);
416 repHdr->
plen = htons(
static_cast<short>(bfSize));
423 xfrRecs = totRecs = 0;
430 char *XrdXrootdMonFile::GetSlot(
int slotSZ)
443 {
if ((repNext + slotSZ) > repLast)
448 repTOD->
tBeg = htonl(
static_cast<int>(time(0)));
465 unsigned int uDID,
bool isRW)
470 int i = 0, sNum = -1, rLen, pLen = 0;
482 {
if ((sNum = fmMap[i].Insert(fsP)) >= 0)
484 if (i > fmHWM) fmHWM = i;
502 {pLen = strlen(
Path);
504 i = (rLen + 8) & ~0x00000003;
505 pLen = pLen + (i - rLen);
517 oP->
Hdr.
recSize = htons(
static_cast<short>(rLen));
const kXR_char XROOTD_MON_MAPFSTA
void Schedule(XrdJob *jp)
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
struct XrdXrootdFileStats::@167 ssq
static void Disc(unsigned int usrID)
static void Defaults(int intv, int opts, int iocnt, int fbsz)
static void Open(XrdXrootdFileStats *fsP, const char *Path, unsigned int uDID, bool isRW)
static void Close(XrdXrootdFileStats *fsP, bool isDisc=false)
static int Send(int mmode, void *buff, int size, bool setseq=true)
static kXR_unt32 GetDictID(bool hbo=false)