XRootD
XrdPfc::Stats Class Reference

Statistics of cache utilisation by a File object. More...

#include <XrdPfcStats.hh>

+ Collaboration diagram for XrdPfc::Stats:

Public Member Functions

 Stats ()
 
 Stats (const Stats &s)
 
void AddBytesHit (long long bh)
 
void AddReadStats (const Stats &s)
 
void AddUp (const Stats &s)
 
void AddWriteStats (long long bytes_written, int n_cks_errs)
 
Stats Clone ()
 
void DeltaToReference (const Stats &ref)
 
void IoAttach ()
 
void IoDetach (int duration)
 
Statsoperator= (const Stats &)=default
 
void Reset ()
 

Public Attributes

long long m_BytesBypassed
 number of bytes served directly through XrdCl More...
 
long long m_BytesHit
 number of bytes served from disk More...
 
long long m_BytesMissed
 number of bytes served from remote and cached More...
 
long long m_BytesWritten
 number of bytes written to disk More...
 
int m_Duration
 total duration of all IOs attached More...
 
int m_NCksumErrors
 number of checksum errors while getting data from remote More...
 
int m_NumIos
 number of IO objects attached during this access More...
 

Detailed Description

Statistics of cache utilisation by a File object.

Definition at line 30 of file XrdPfcStats.hh.

Constructor & Destructor Documentation

◆ Stats() [1/2]

XrdPfc::Stats::Stats ( )
inline

Definition at line 43 of file XrdPfcStats.hh.

43  :
44  m_NumIos (0), m_Duration(0),
47  {}
long long m_BytesMissed
number of bytes served from remote and cached
Definition: XrdPfcStats.hh:36
long long m_BytesBypassed
number of bytes served directly through XrdCl
Definition: XrdPfcStats.hh:37
int m_NCksumErrors
number of checksum errors while getting data from remote
Definition: XrdPfcStats.hh:39
int m_Duration
total duration of all IOs attached
Definition: XrdPfcStats.hh:34
int m_NumIos
number of IO objects attached during this access
Definition: XrdPfcStats.hh:33
long long m_BytesHit
number of bytes served from disk
Definition: XrdPfcStats.hh:35
long long m_BytesWritten
number of bytes written to disk
Definition: XrdPfcStats.hh:38

Referenced by Clone().

+ Here is the caller graph for this function:

◆ Stats() [2/2]

XrdPfc::Stats::Stats ( const Stats s)
inline

Definition at line 49 of file XrdPfcStats.hh.

49  :
50  m_NumIos (s.m_NumIos), m_Duration(s.m_Duration),
51  m_BytesHit(s.m_BytesHit), m_BytesMissed(s.m_BytesMissed), m_BytesBypassed(s.m_BytesBypassed),
52  m_BytesWritten(s.m_BytesWritten), m_NCksumErrors(s.m_NCksumErrors)
53  {}

Member Function Documentation

◆ AddBytesHit()

void XrdPfc::Stats::AddBytesHit ( long long  bh)
inline

Definition at line 68 of file XrdPfcStats.hh.

69  {
70  XrdSysMutexHelper _lock(&m_Mutex);
71 
72  m_BytesHit += bh;
73  }

References m_BytesHit.

Referenced by XrdPfc::File::Read(), and XrdPfc::File::ReadV().

+ Here is the caller graph for this function:

◆ AddReadStats()

void XrdPfc::Stats::AddReadStats ( const Stats s)
inline

Definition at line 59 of file XrdPfcStats.hh.

60  {
61  XrdSysMutexHelper _lock(&m_Mutex);
62 
63  m_BytesHit += s.m_BytesHit;
64  m_BytesMissed += s.m_BytesMissed;
65  m_BytesBypassed += s.m_BytesBypassed;
66  }

References m_BytesBypassed, m_BytesHit, and m_BytesMissed.

◆ AddUp()

void XrdPfc::Stats::AddUp ( const Stats s)
inline

Definition at line 118 of file XrdPfcStats.hh.

119  {
120  // Not locked, only used from Cache / Purge thread.
121  m_NumIos += s.m_NumIos;
122  m_Duration += s.m_Duration;
123  m_BytesHit += s.m_BytesHit;
124  m_BytesMissed += s.m_BytesMissed;
125  m_BytesBypassed += s.m_BytesBypassed;
126  m_BytesWritten += s.m_BytesWritten;
127  m_NCksumErrors += s.m_NCksumErrors;
128  }

References m_BytesBypassed, m_BytesHit, m_BytesMissed, m_BytesWritten, m_Duration, m_NCksumErrors, and m_NumIos.

Referenced by XrdPfc::DirState::add_up_stats(), and XrdPfc::DirState::upward_propagate_stats().

+ Here is the caller graph for this function:

◆ AddWriteStats()

void XrdPfc::Stats::AddWriteStats ( long long  bytes_written,
int  n_cks_errs 
)
inline

Definition at line 75 of file XrdPfcStats.hh.

76  {
77  XrdSysMutexHelper _lock(&m_Mutex);
78 
79  m_BytesWritten += bytes_written;
80  m_NCksumErrors += n_cks_errs;
81  }

References m_BytesWritten, and m_NCksumErrors.

◆ Clone()

Stats XrdPfc::Stats::Clone ( )
inline

Definition at line 97 of file XrdPfcStats.hh.

98  {
99  XrdSysMutexHelper _lock(&m_Mutex);
100 
101  return Stats(*this);
102  }

References Stats().

Referenced by XrdPfc::File::DeltaStatsFromLastCall(), XrdPfc::File::FinalizeSyncBeforeExit(), and XrdPfc::File::Sync().

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

◆ DeltaToReference()

void XrdPfc::Stats::DeltaToReference ( const Stats ref)
inline

Definition at line 106 of file XrdPfcStats.hh.

107  {
108  // Not locked, only used from Cache / Purge thread.
109  m_NumIos = ref.m_NumIos - m_NumIos;
110  m_Duration = ref.m_Duration - m_Duration;
111  m_BytesHit = ref.m_BytesHit - m_BytesHit;
112  m_BytesMissed = ref.m_BytesMissed - m_BytesMissed;
113  m_BytesBypassed = ref.m_BytesBypassed - m_BytesBypassed;
114  m_BytesWritten = ref.m_BytesWritten - m_BytesWritten;
115  m_NCksumErrors = ref.m_NCksumErrors - m_NCksumErrors;
116  }

References m_BytesBypassed, m_BytesHit, m_BytesMissed, m_BytesWritten, m_Duration, m_NCksumErrors, and m_NumIos.

Referenced by XrdPfc::File::DeltaStatsFromLastCall().

+ Here is the caller graph for this function:

◆ IoAttach()

void XrdPfc::Stats::IoAttach ( )
inline

Definition at line 83 of file XrdPfcStats.hh.

84  {
85  XrdSysMutexHelper _lock(&m_Mutex);
86 
87  ++m_NumIos;
88  }

References m_NumIos.

Referenced by XrdPfc::File::AddIO().

+ Here is the caller graph for this function:

◆ IoDetach()

void XrdPfc::Stats::IoDetach ( int  duration)
inline

Definition at line 90 of file XrdPfcStats.hh.

91  {
92  XrdSysMutexHelper _lock(&m_Mutex);
93 
94  m_Duration += duration;
95  }

References m_Duration.

Referenced by XrdPfc::File::RemoveIO().

+ Here is the caller graph for this function:

◆ operator=()

Stats& XrdPfc::Stats::operator= ( const Stats )
default

◆ Reset()

void XrdPfc::Stats::Reset ( )
inline

Definition at line 130 of file XrdPfcStats.hh.

131  {
132  // Not locked, only used from Cache / Purge thread.
133  m_NumIos = 0;
134  m_Duration = 0;
135  m_BytesHit = 0;
136  m_BytesMissed = 0;
137  m_BytesBypassed = 0;
138  m_BytesWritten = 0;
139  m_NCksumErrors = 0;
140  }

References m_BytesBypassed, m_BytesHit, m_BytesMissed, m_BytesWritten, m_Duration, m_NCksumErrors, and m_NumIos.

Referenced by XrdPfc::DirState::reset_stats().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_BytesBypassed

long long XrdPfc::Stats::m_BytesBypassed

number of bytes served directly through XrdCl

Definition at line 37 of file XrdPfcStats.hh.

Referenced by AddReadStats(), AddUp(), DeltaToReference(), XrdPfc::DirState::dump_recursively(), Reset(), and XrdPfc::Info::WriteIOStat().

◆ m_BytesHit

long long XrdPfc::Stats::m_BytesHit

number of bytes served from disk

Definition at line 35 of file XrdPfcStats.hh.

Referenced by AddBytesHit(), AddReadStats(), AddUp(), DeltaToReference(), XrdPfc::DirState::dump_recursively(), Reset(), and XrdPfc::Info::WriteIOStat().

◆ m_BytesMissed

long long XrdPfc::Stats::m_BytesMissed

number of bytes served from remote and cached

Definition at line 36 of file XrdPfcStats.hh.

Referenced by AddReadStats(), AddUp(), DeltaToReference(), XrdPfc::DirState::dump_recursively(), Reset(), and XrdPfc::Info::WriteIOStat().

◆ m_BytesWritten

long long XrdPfc::Stats::m_BytesWritten

◆ m_Duration

int XrdPfc::Stats::m_Duration

total duration of all IOs attached

Definition at line 34 of file XrdPfcStats.hh.

Referenced by AddUp(), DeltaToReference(), XrdPfc::DirState::dump_recursively(), IoDetach(), Reset(), and XrdPfc::Info::WriteIOStat().

◆ m_NCksumErrors

int XrdPfc::Stats::m_NCksumErrors

number of checksum errors while getting data from remote

Definition at line 39 of file XrdPfcStats.hh.

Referenced by AddUp(), AddWriteStats(), DeltaToReference(), and Reset().

◆ m_NumIos

int XrdPfc::Stats::m_NumIos

number of IO objects attached during this access

Definition at line 33 of file XrdPfcStats.hh.

Referenced by AddUp(), DeltaToReference(), XrdPfc::DirState::dump_recursively(), IoAttach(), Reset(), and XrdPfc::Info::WriteIOStat().


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