00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 const char *XrdOfsStatsCVSID = "$Id: XrdOfsStats.cc 30949 2009-11-02 16:37:58Z ganis $";
00014
00015 #include <stdio.h>
00016
00017 #include "XrdOfs/XrdOfsStats.hh"
00018
00019
00020
00021
00022
00023 int XrdOfsStats::Report(char *buff, int blen)
00024 {
00025 static const char stats1[] = "<stats id=\"ofs\"><role>%s</role>"
00026 "<opr>%d</opr><opw>%d</opw><opp>%d</opp><ups>%d</ups><han>%d</han>"
00027 "<rdr>%d</rdr><bxq>%d</bxq><rep>%d</rep><err>%d</err><dly>%d</dly>"
00028 "<sok>%d</sok><ser>%d</ser></stats>";
00029 static const int statsz = sizeof(stats1) + (12*10) + 64;
00030
00031 StatsData myData;
00032
00033
00034
00035 if (!buff) return statsz;
00036
00037
00038
00039 if (blen < statsz) return 0;
00040
00041
00042
00043 sdMutex.Lock();
00044 myData = Data;
00045 sdMutex.UnLock();
00046
00047
00048
00049 return sprintf(buff, stats1, myRole, myData.numOpenR, myData.numOpenW,
00050 myData.numOpenP, myData.numUnpsist, myData.numHandles,
00051 myData.numRedirect, myData.numStarted, myData.numReplies,
00052 myData.numErrors, myData.numDelays,
00053 myData.numSeventOK, myData.numSeventER);
00054 }