XRootD
XrdOfsStats Class Reference

#include <XrdOfsStats.hh>

+ Collaboration diagram for XrdOfsStats:

Classes

struct  StatsData
 

Public Member Functions

 XrdOfsStats ()
 
 ~XrdOfsStats ()
 
void Add (int &Cntr)
 
void Dec (int &Cntr)
 
int Report (char *Buff, int Blen)
 
void setRole (const char *theRole)
 

Public Attributes

struct XrdOfsStats::StatsData Data
 
XrdSysMutex sdMutex
 

Detailed Description

Definition at line 36 of file XrdOfsStats.hh.


Class Documentation

◆ XrdOfsStats::StatsData

struct XrdOfsStats::StatsData

Definition at line 40 of file XrdOfsStats.hh.

+ Collaboration diagram for XrdOfsStats::StatsData:
Class Members
int numDelays
int numErrors
int numHandles
int numOpenP
int numOpenR
int numOpenW
int numRedirect
int numReplies
int numSeventER
int numSeventOK
int numStarted
int numTPCdeny
int numTPCerrs
int numTPCexpr
int numTPCgrant
int numUnpsist

Constructor & Destructor Documentation

◆ XrdOfsStats()

XrdOfsStats::XrdOfsStats ( )
inline

Definition at line 70 of file XrdOfsStats.hh.

70 : myRole("?") {memset(&Data, 0, sizeof(Data));}
struct XrdOfsStats::StatsData Data

References Data.

◆ ~XrdOfsStats()

XrdOfsStats::~XrdOfsStats ( )
inline

Definition at line 71 of file XrdOfsStats.hh.

71 {}

Member Function Documentation

◆ Add()

void XrdOfsStats::Add ( int &  Cntr)
inline

Definition at line 62 of file XrdOfsStats.hh.

62 {sdMutex.Lock(); Cntr++; sdMutex.UnLock();}
XrdSysMutex sdMutex
Definition: XrdOfsStats.hh:60

References XrdSysMutex::Lock(), sdMutex, and XrdSysMutex::UnLock().

Referenced by XrdOfsHandle::Alloc(), XrdOfsTPC::Authorize(), XrdOfsTPCAuth::Expired(), XrdOfsTPCInfo::Fail(), XrdOfsTPC::Fatal(), XrdOfsTPC::Screen(), and XrdOfs::Unpersist().

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

◆ Dec()

void XrdOfsStats::Dec ( int &  Cntr)
inline

Definition at line 64 of file XrdOfsStats.hh.

64 {sdMutex.Lock(); Cntr--; sdMutex.UnLock();}

References XrdSysMutex::Lock(), sdMutex, and XrdSysMutex::UnLock().

Referenced by XrdOfsHandle::Retire().

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

◆ Report()

int XrdOfsStats::Report ( char *  Buff,
int  Blen 
)

Definition at line 38 of file XrdOfsStats.cc.

39 {
40  static const char stats1[] = "<stats id=\"ofs\"><role>%s</role>"
41  "<opr>%d</opr><opw>%d</opw><opp>%d</opp><ups>%d</ups><han>%d</han>"
42  "<rdr>%d</rdr><bxq>%d</bxq><rep>%d</rep><err>%d</err><dly>%d</dly>"
43  "<sok>%d</sok><ser>%d</ser>"
44  "<tpc><grnt>%d</grnt><deny>%d</deny><err>%d</err><exp>%d</exp></tpc>"
45  "</stats>";
46  static const int statsz = sizeof(stats1) + (12*10) + 64;
47 
48  StatsData myData;
49 
50 // If only the size is wanted, return the size
51 //
52  if (!buff) return statsz;
53 
54 // Make sure buffer is large enough
55 //
56  if (blen < statsz) return 0;
57 
58 // Get a copy of the statistics
59 //
60  sdMutex.Lock();
61  myData = Data;
62  sdMutex.UnLock();
63 
64 // Format the buffer
65 //
66  return sprintf(buff, stats1, myRole, myData.numOpenR, myData.numOpenW,
67  myData.numOpenP, myData.numUnpsist, myData.numHandles,
68  myData.numRedirect, myData.numStarted, myData.numReplies,
69  myData.numErrors, myData.numDelays,
70  myData.numSeventOK, myData.numSeventER,
71  myData.numTPCgrant, myData.numTPCdeny,
72  myData.numTPCerrs, myData.numTPCexpr);
73 }

References Data, XrdSysMutex::Lock(), XrdOfsStats::StatsData::numDelays, XrdOfsStats::StatsData::numErrors, XrdOfsStats::StatsData::numHandles, XrdOfsStats::StatsData::numOpenP, XrdOfsStats::StatsData::numOpenR, XrdOfsStats::StatsData::numOpenW, XrdOfsStats::StatsData::numRedirect, XrdOfsStats::StatsData::numReplies, XrdOfsStats::StatsData::numSeventER, XrdOfsStats::StatsData::numSeventOK, XrdOfsStats::StatsData::numStarted, XrdOfsStats::StatsData::numTPCdeny, XrdOfsStats::StatsData::numTPCerrs, XrdOfsStats::StatsData::numTPCexpr, XrdOfsStats::StatsData::numTPCgrant, XrdOfsStats::StatsData::numUnpsist, sdMutex, and XrdSysMutex::UnLock().

Referenced by XrdOfs::getStats().

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

◆ setRole()

void XrdOfsStats::setRole ( const char *  theRole)
inline

Definition at line 68 of file XrdOfsStats.hh.

68 {myRole = theRole;}

Referenced by XrdOfs::Configure().

+ Here is the caller graph for this function:

Member Data Documentation

◆ Data

◆ sdMutex

XrdSysMutex XrdOfsStats::sdMutex

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