XRootD
XrdXrootdStats Class Reference

#include <XrdXrootdStats.hh>

+ Inheritance diagram for XrdXrootdStats:
+ Collaboration diagram for XrdXrootdStats:

Public Member Functions

 XrdXrootdStats (XrdStats *sp)
 
 ~XrdXrootdStats ()
 
void setFS (XrdSfsFileSystem *fsp)
 
int Stats (char *buff, int blen, int do_sync=0)
 
int Stats (XrdXrootdResponse &resp, const char *opts)
 
- Public Member Functions inherited from XrdOucStats
 XrdOucStats ()
 
 ~XrdOucStats ()
 
void Bump (int &val)
 
void Bump (int &val, int n)
 
void Bump (long long &val)
 
void Bump (long long &val, long long n)
 

Public Attributes

int aokSCnt
 
int AsyncMax
 
long long AsyncNow
 
long long AsyncNum
 
long long AsyncRej
 
int AuthBad
 
int badSCnt
 
int Count
 
int errorCnt
 
int getfCnt
 
int ignSCnt
 
int LoginAT
 
int LoginAU
 
int LoginUA
 
int miscCnt
 
int openCnt
 
long long prerCnt
 
int putfCnt
 
long long readCnt
 
long long redirCnt
 
int Refresh
 
long long rsegCnt
 
long long rvecCnt
 
int stallCnt
 
int syncCnt
 
long long writeCnt
 
long long wsegCnt
 
long long wvecCnt
 
- Public Attributes inherited from XrdOucStats
XrdSysMutex statsMutex
 

Detailed Description

Definition at line 39 of file XrdXrootdStats.hh.

Constructor & Destructor Documentation

◆ XrdXrootdStats()

XrdXrootdStats::XrdXrootdStats ( XrdStats sp)

Definition at line 41 of file XrdXrootdStats.cc.

42 {
43 
44 xstats = sp;
45 fsP = 0;
46 
47 Count = 0; // Stats: Number of matches
48 errorCnt = 0; // Stats: Number of errors returned
49 redirCnt = 0; // Stats: Number of redirects
50 stallCnt = 0; // Stats: Number of stalls
51 getfCnt = 0; // Stats: Number of getfiles
52 putfCnt = 0; // Stats: Number of putfiles
53 openCnt = 0; // Stats: Number of opens
54 readCnt = 0; // Stats: Number of reads
55 prerCnt = 0; // Stats: Number of reads
56 rvecCnt = 0; // Stats: Number of readv
57 rsegCnt = 0; // Stats: Number of readv segments
58 wvecCnt = 0; // Stats: Number of writev
59 wsegCnt = 0; // Stats: Number of writev segments
60 writeCnt = 0; // Stats: Number of writes
61 syncCnt = 0; // Stats: Number of sync
62 miscCnt = 0; // Stats: Number of miscellaneous
63 AsyncNum = 0; // Stats: Number of async ops
64 AsyncMax = 0; // Stats: Number of async max
65 AsyncRej = 0; // Stats: Number of async rejected
66 AsyncNow = 0; // Stats: Number of async now (not locked)
67 Refresh = 0; // Stats: Number of refresh requests
68 LoginAT = 0; // Stats: Number of attempted logins
69 LoginAU = 0; // Stats: Number of authenticated logins
70 LoginUA = 0; // Stats: Number of unauthenticated logins
71 AuthBad = 0; // Stats: Number of authentication failures
72 aokSCnt = 0; // Stats: Number of signature successes
73 badSCnt = 0; // Stats: Number of signature failures
74 ignSCnt = 0; // Stats: Number of signature ignored
75 }
long long AsyncRej
long long rsegCnt
long long wsegCnt
long long AsyncNow
long long redirCnt
long long readCnt
long long prerCnt
long long AsyncNum
long long rvecCnt
long long writeCnt
long long wvecCnt

References aokSCnt, AsyncMax, AsyncNow, AsyncNum, AsyncRej, AuthBad, badSCnt, Count, errorCnt, getfCnt, ignSCnt, LoginAT, LoginAU, LoginUA, miscCnt, openCnt, prerCnt, putfCnt, readCnt, redirCnt, Refresh, rsegCnt, rvecCnt, stallCnt, syncCnt, writeCnt, wsegCnt, and wvecCnt.

◆ ~XrdXrootdStats()

XrdXrootdStats::~XrdXrootdStats ( )
inline

Definition at line 78 of file XrdXrootdStats.hh.

78 {}

Member Function Documentation

◆ setFS()

void XrdXrootdStats::setFS ( XrdSfsFileSystem fsp)
inline

Definition at line 71 of file XrdXrootdStats.hh.

71 {fsP = fsp;}

◆ Stats() [1/2]

int XrdXrootdStats::Stats ( char *  buff,
int  blen,
int  do_sync = 0 
)

Definition at line 81 of file XrdXrootdStats.cc.

82 {
83  static const char statfmt[] = "<stats id=\"xrootd\"><num>%d</num>"
84  "<ops><open>%d</open><rf>%d</rf><rd>%lld</rd><pr>%lld</pr>"
85  "<rv>%lld</rv><rs>%lld</rs>"
86  "<wv>%lld</wv><ws>%lld</ws><wr>%lld</wr>"
87  "<sync>%d</sync><getf>%d</getf><putf>%d</putf><misc>%d</misc></ops>"
88  "<sig><ok>%d</ok><bad>%d</bad><ign>%d</ign></sig>"
89  "<aio><num>%lld</num><max>%d</max><rej>%lld</rej></aio>"
90  "<err>%d</err><rdr>%lld</rdr><dly>%d</dly>"
91  "<lgn><num>%d</num><af>%d</af><au>%d</au><ua>%d</ua></lgn></stats>";
92 // 1 2 3 4 5 6 7 8
93  static const long long LLMax = 0x7fffffffffffffffLL;
94  static const int INMax = 0x7fffffff;
95  int len;
96 
97 // If no buffer, caller wants the maximum size we will generate
98 //
99  if (!buff)
100  {char dummy[4096]; // Almost any size will do
101  len = snprintf(dummy, sizeof(dummy), statfmt,
102  INMax, INMax, INMax, LLMax,
103  LLMax, LLMax, LLMax, LLMax, LLMax, LLMax, INMax, INMax,
104  INMax, INMax,
105  INMax, INMax, INMax,
106  LLMax, INMax, LLMax, INMax, LLMax, INMax,
107  INMax, INMax, INMax, INMax);
108  return len + (fsP ? fsP->getStats(0,0) : 0);
109  }
110 
111 // Format our statistics
112 //
113  statsMutex.Lock();
114  len = snprintf(buff, blen, statfmt,
117  syncCnt, getfCnt,
118  putfCnt, miscCnt,
122  statsMutex.UnLock();
123 
124 // Now include filesystem statistics and return
125 //
126  if (fsP) len += fsP->getStats(buff+len, blen-len);
127  return len;
128 }
XrdSysMutex statsMutex
Definition: XrdOucStats.hh:55
virtual int getStats(char *buff, int blen)=0

References aokSCnt, AsyncMax, AsyncNum, AsyncRej, AuthBad, badSCnt, Count, errorCnt, getfCnt, XrdSfsFileSystem::getStats(), ignSCnt, XrdSysMutex::Lock(), LoginAT, LoginAU, LoginUA, miscCnt, openCnt, prerCnt, putfCnt, readCnt, redirCnt, Refresh, rsegCnt, rvecCnt, stallCnt, XrdOucStats::statsMutex, syncCnt, XrdSysMutex::UnLock(), writeCnt, wsegCnt, and wvecCnt.

Referenced by XrdXrootdProtocol::Stats().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Stats() [2/2]

int XrdXrootdStats::Stats ( XrdXrootdResponse resp,
const char *  opts 
)

Definition at line 134 of file XrdXrootdStats.cc.

135 {
136  class statsInfo : public XrdStats::CallBack
137  {public: void Info(const char *buff, int bsz)
138  {rc = respP->Send((void *)buff, bsz+1);}
139  statsInfo(XrdXrootdResponse *rP) : respP(rP), rc(0) {}
140  ~statsInfo() {}
141  XrdXrootdResponse *respP;
142  int rc;
143  };
144  statsInfo statsResp(&resp);
145  int xopts = 0;
146 
147  while(*opts)
148  {switch(*opts)
149  {case 'a': xopts |= XRD_STATS_ALL; break;
150  case 'b': xopts |= XRD_STATS_BUFF; break; // b_uff
151  case 'i': xopts |= XRD_STATS_INFO; break; // i_nfo
152  case 'l': xopts |= XRD_STATS_LINK; break; // l_ink
153  case 'd': xopts |= XRD_STATS_POLL; break; // d_evice
154  case 'u': xopts |= XRD_STATS_PROC; break; // u_sage
155  case 'p': xopts |= XRD_STATS_PROT; break; // p_rotocol
156  case 's': xopts |= XRD_STATS_SCHD; break; // s_scheduler
157  default: break;
158  }
159  opts++;
160  }
161 
162  if (!xopts) return resp.Send();
163 
164  xstats->Stats(&statsResp, xopts);
165  return statsResp.rc;
166 }
@ Info
struct myOpts opts
#define XRD_STATS_POLL
Definition: XrdStats.hh:40
#define XRD_STATS_INFO
Definition: XrdStats.hh:37
#define XRD_STATS_LINK
Definition: XrdStats.hh:39
#define XRD_STATS_BUFF
Definition: XrdStats.hh:38
#define XRD_STATS_SCHD
Definition: XrdStats.hh:43
#define XRD_STATS_ALL
Definition: XrdStats.hh:36
#define XRD_STATS_PROT
Definition: XrdStats.hh:42
#define XRD_STATS_PROC
Definition: XrdStats.hh:41
virtual void Stats(CallBack *InfoBack, int opts)
Definition: XrdStats.cc:150

References Info, opts, XrdXrootdResponse::Send(), XrdStats::Stats(), XRD_STATS_ALL, XRD_STATS_BUFF, XRD_STATS_INFO, XRD_STATS_LINK, XRD_STATS_POLL, XRD_STATS_PROC, XRD_STATS_PROT, and XRD_STATS_SCHD.

+ Here is the call graph for this function:

Member Data Documentation

◆ aokSCnt

int XrdXrootdStats::aokSCnt

Definition at line 67 of file XrdXrootdStats.hh.

Referenced by XrdXrootdStats(), XrdXrootdProtocol::Process2(), and Stats().

◆ AsyncMax

int XrdXrootdStats::AsyncMax

Definition at line 61 of file XrdXrootdStats.hh.

Referenced by XrdXrootdStats(), and Stats().

◆ AsyncNow

long long XrdXrootdStats::AsyncNow

Definition at line 60 of file XrdXrootdStats.hh.

Referenced by XrdXrootdStats().

◆ AsyncNum

long long XrdXrootdStats::AsyncNum

Definition at line 58 of file XrdXrootdStats.hh.

Referenced by XrdXrootdStats(), and Stats().

◆ AsyncRej

long long XrdXrootdStats::AsyncRej

Definition at line 59 of file XrdXrootdStats.hh.

Referenced by XrdXrootdStats(), and Stats().

◆ AuthBad

int XrdXrootdStats::AuthBad

Definition at line 66 of file XrdXrootdStats.hh.

Referenced by XrdXrootdStats(), and Stats().

◆ badSCnt

int XrdXrootdStats::badSCnt

Definition at line 68 of file XrdXrootdStats.hh.

Referenced by XrdXrootdStats(), XrdXrootdProtocol::Process2(), and Stats().

◆ Count

int XrdXrootdStats::Count

Definition at line 42 of file XrdXrootdStats.hh.

Referenced by XrdXrootdStats(), XrdXrootdProtocol::Match(), and Stats().

◆ errorCnt

int XrdXrootdStats::errorCnt

Definition at line 43 of file XrdXrootdStats.hh.

Referenced by XrdXrootdStats(), XrdXrootdCallBack::sendError(), and Stats().

◆ getfCnt

int XrdXrootdStats::getfCnt

Definition at line 46 of file XrdXrootdStats.hh.

Referenced by XrdXrootdStats(), and Stats().

◆ ignSCnt

int XrdXrootdStats::ignSCnt

Definition at line 69 of file XrdXrootdStats.hh.

Referenced by XrdXrootdStats(), XrdXrootdProtocol::Process2(), and Stats().

◆ LoginAT

int XrdXrootdStats::LoginAT

Definition at line 63 of file XrdXrootdStats.hh.

Referenced by XrdXrootdStats(), and Stats().

◆ LoginAU

int XrdXrootdStats::LoginAU

Definition at line 64 of file XrdXrootdStats.hh.

Referenced by XrdXrootdStats(), and Stats().

◆ LoginUA

int XrdXrootdStats::LoginUA

Definition at line 65 of file XrdXrootdStats.hh.

Referenced by XrdXrootdStats(), and Stats().

◆ miscCnt

int XrdXrootdStats::miscCnt

Definition at line 57 of file XrdXrootdStats.hh.

Referenced by XrdXrootdStats(), XrdXrootdProtocol::Process2(), and Stats().

◆ openCnt

int XrdXrootdStats::openCnt

Definition at line 48 of file XrdXrootdStats.hh.

Referenced by XrdXrootdStats(), and Stats().

◆ prerCnt

long long XrdXrootdStats::prerCnt

Definition at line 50 of file XrdXrootdStats.hh.

Referenced by XrdXrootdStats(), Stats(), and XrdXrootdProtocol::Stats().

◆ putfCnt

int XrdXrootdStats::putfCnt

Definition at line 47 of file XrdXrootdStats.hh.

Referenced by XrdXrootdStats(), and Stats().

◆ readCnt

long long XrdXrootdStats::readCnt

Definition at line 49 of file XrdXrootdStats.hh.

Referenced by XrdXrootdStats(), Stats(), and XrdXrootdProtocol::Stats().

◆ redirCnt

long long XrdXrootdStats::redirCnt

Definition at line 44 of file XrdXrootdStats.hh.

Referenced by XrdXrootdStats(), XrdXrootdCallBack::sendError(), and Stats().

◆ Refresh

int XrdXrootdStats::Refresh

Definition at line 62 of file XrdXrootdStats.hh.

Referenced by XrdXrootdStats(), and Stats().

◆ rsegCnt

long long XrdXrootdStats::rsegCnt

Definition at line 51 of file XrdXrootdStats.hh.

Referenced by XrdXrootdStats(), Stats(), and XrdXrootdProtocol::Stats().

◆ rvecCnt

long long XrdXrootdStats::rvecCnt

Definition at line 52 of file XrdXrootdStats.hh.

Referenced by XrdXrootdStats(), Stats(), and XrdXrootdProtocol::Stats().

◆ stallCnt

int XrdXrootdStats::stallCnt

Definition at line 45 of file XrdXrootdStats.hh.

Referenced by XrdXrootdStats(), XrdXrootdCallBack::sendError(), and Stats().

◆ syncCnt

int XrdXrootdStats::syncCnt

Definition at line 56 of file XrdXrootdStats.hh.

Referenced by XrdXrootdStats(), and Stats().

◆ writeCnt

long long XrdXrootdStats::writeCnt

Definition at line 55 of file XrdXrootdStats.hh.

Referenced by XrdXrootdStats(), Stats(), and XrdXrootdProtocol::Stats().

◆ wsegCnt

long long XrdXrootdStats::wsegCnt

Definition at line 53 of file XrdXrootdStats.hh.

Referenced by XrdXrootdStats(), Stats(), and XrdXrootdProtocol::Stats().

◆ wvecCnt

long long XrdXrootdStats::wvecCnt

Definition at line 54 of file XrdXrootdStats.hh.

Referenced by XrdXrootdStats(), Stats(), and XrdXrootdProtocol::Stats().


The documentation for this class was generated from the following files: