test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes | Friends
XrdAdaptor::XrdSiteStatistics Class Reference

#include <XrdStatistics.h>

Public Member Functions

void finishRead (XrdReadStatistics const &)
 
XrdSiteStatisticsoperator= (const XrdSiteStatistics &)=delete
 
void recomputeProperties (std::map< std::string, std::string > &props)
 
std::string const & site () const
 
 XrdSiteStatistics (std::string const &site)
 
 XrdSiteStatistics (const XrdSiteStatistics &)=delete
 

Static Public Member Functions

static std::shared_ptr
< XrdReadStatistics
startRead (std::shared_ptr< XrdSiteStatistics > parent, std::shared_ptr< ClientRequest > req)
 

Private Attributes

std::atomic< unsigned > m_chunkCount
 
std::atomic< unsigned > m_readCount
 
std::atomic< uint64_t > m_readNS
 
std::atomic< uint64_t > m_readSize
 
std::atomic< unsigned > m_readvCount
 
std::atomic< uint64_t > m_readvNS
 
std::atomic< uint64_t > m_readvSize
 
const std::string m_site = "Unknown"
 

Friends

class XrdReadStatistics
 

Detailed Description

Definition at line 65 of file XrdStatistics.h.

Constructor & Destructor Documentation

XrdSiteStatistics::XrdSiteStatistics ( std::string const &  site)

Definition at line 92 of file XrdStatistics.cc.

92  :
93  m_site(site),
94  m_readvCount(0),
95  m_chunkCount(0),
96  m_readvSize(0),
97  m_readvNS(0.0),
98  m_readCount(0),
99  m_readSize(0),
100  m_readNS(0)
101 {
102 }
std::string const & site() const
Definition: XrdStatistics.h:74
std::atomic< unsigned > m_readCount
Definition: XrdStatistics.h:91
std::atomic< uint64_t > m_readvSize
Definition: XrdStatistics.h:89
std::atomic< unsigned > m_readvCount
Definition: XrdStatistics.h:87
std::atomic< uint64_t > m_readvNS
Definition: XrdStatistics.h:90
std::atomic< uint64_t > m_readNS
Definition: XrdStatistics.h:93
std::atomic< uint64_t > m_readSize
Definition: XrdStatistics.h:92
std::atomic< unsigned > m_chunkCount
Definition: XrdStatistics.h:88
XrdAdaptor::XrdSiteStatistics::XrdSiteStatistics ( const XrdSiteStatistics )
delete

Member Function Documentation

void XrdSiteStatistics::finishRead ( XrdReadStatistics const &  readStats)

Definition at line 147 of file XrdStatistics.cc.

References XrdAdaptor::XrdReadStatistics::elapsedNS(), m_chunkCount, m_readCount, m_readNS, m_readSize, m_readvCount, m_readvNS, m_readvSize, XrdAdaptor::XrdReadStatistics::readCount(), and XrdAdaptor::XrdReadStatistics::size().

148 {
149  if (readStats.readCount() > 1)
150  {
151  m_readvCount ++;
152  m_chunkCount += readStats.readCount();
153  m_readvSize += readStats.size();
154  m_readvNS += readStats.elapsedNS();
155  }
156  else
157  {
158  m_readCount ++;
159  m_readSize += readStats.size();
160  m_readNS += readStats.elapsedNS();
161  }
162 }
std::atomic< unsigned > m_readCount
Definition: XrdStatistics.h:91
std::atomic< uint64_t > m_readvSize
Definition: XrdStatistics.h:89
std::atomic< unsigned > m_readvCount
Definition: XrdStatistics.h:87
std::atomic< uint64_t > m_readvNS
Definition: XrdStatistics.h:90
std::atomic< uint64_t > m_readNS
Definition: XrdStatistics.h:93
std::atomic< uint64_t > m_readSize
Definition: XrdStatistics.h:92
std::atomic< unsigned > m_chunkCount
Definition: XrdStatistics.h:88
XrdSiteStatistics& XrdAdaptor::XrdSiteStatistics::operator= ( const XrdSiteStatistics )
delete
void XrdSiteStatistics::recomputeProperties ( std::map< std::string, std::string > &  props)

Definition at line 131 of file XrdStatistics.cc.

References d2str(), i2str(), m_chunkCount, m_readCount, m_readNS, m_readSize, m_readvCount, m_readvNS, and m_readvSize.

132 {
133  props.clear();
134 
135  props["readv-numOperations"] = i2str(m_readvCount);
136  props["readv-numChunks"] = i2str(m_chunkCount);
137  props["readv-totalMegabytes"] = d2str(static_cast<float>(m_readvSize)/(1024.0*1024.0));
138  props["readv-totalMsecs"] = d2str(m_readvNS/1e6);
139 
140  props["read-numOperations"] = i2str(m_readCount);
141  props["read-totalMegabytes"] = d2str(static_cast<float>(m_readSize)/(1024.0*1024.0));
142  props["read-totalMsecs"] = d2str(static_cast<float>(m_readNS)/1e6);
143 }
std::atomic< unsigned > m_readCount
Definition: XrdStatistics.h:91
std::atomic< uint64_t > m_readvSize
Definition: XrdStatistics.h:89
static std::string d2str(double input)
std::atomic< unsigned > m_readvCount
Definition: XrdStatistics.h:87
std::atomic< uint64_t > m_readvNS
Definition: XrdStatistics.h:90
std::atomic< uint64_t > m_readNS
Definition: XrdStatistics.h:93
static std::string i2str(int input)
std::atomic< uint64_t > m_readSize
Definition: XrdStatistics.h:92
std::atomic< unsigned > m_chunkCount
Definition: XrdStatistics.h:88
std::string const& XrdAdaptor::XrdSiteStatistics::site ( ) const
inline

Definition at line 74 of file XrdStatistics.h.

References m_site.

74 {return m_site;}
std::shared_ptr< XrdReadStatistics > XrdSiteStatistics::startRead ( std::shared_ptr< XrdSiteStatistics parent,
std::shared_ptr< ClientRequest req 
)
static

Definition at line 105 of file XrdStatistics.cc.

References XrdReadStatistics.

Referenced by XrdAdaptor::Source::handle().

106 {
107  std::shared_ptr<XrdReadStatistics> readStats(new XrdReadStatistics(parent, req->getSize(), req->getCount()));
108  return readStats;
109 }

Friends And Related Function Documentation

friend class XrdReadStatistics
friend

Definition at line 67 of file XrdStatistics.h.

Referenced by startRead().

Member Data Documentation

std::atomic<unsigned> XrdAdaptor::XrdSiteStatistics::m_chunkCount
private

Definition at line 88 of file XrdStatistics.h.

Referenced by finishRead(), and recomputeProperties().

std::atomic<unsigned> XrdAdaptor::XrdSiteStatistics::m_readCount
private

Definition at line 91 of file XrdStatistics.h.

Referenced by finishRead(), and recomputeProperties().

std::atomic<uint64_t> XrdAdaptor::XrdSiteStatistics::m_readNS
private

Definition at line 93 of file XrdStatistics.h.

Referenced by finishRead(), and recomputeProperties().

std::atomic<uint64_t> XrdAdaptor::XrdSiteStatistics::m_readSize
private

Definition at line 92 of file XrdStatistics.h.

Referenced by finishRead(), and recomputeProperties().

std::atomic<unsigned> XrdAdaptor::XrdSiteStatistics::m_readvCount
private

Definition at line 87 of file XrdStatistics.h.

Referenced by finishRead(), and recomputeProperties().

std::atomic<uint64_t> XrdAdaptor::XrdSiteStatistics::m_readvNS
private

Definition at line 90 of file XrdStatistics.h.

Referenced by finishRead(), and recomputeProperties().

std::atomic<uint64_t> XrdAdaptor::XrdSiteStatistics::m_readvSize
private

Definition at line 89 of file XrdStatistics.h.

Referenced by finishRead(), and recomputeProperties().

const std::string XrdAdaptor::XrdSiteStatistics::m_site = "Unknown"
private

Definition at line 85 of file XrdStatistics.h.

Referenced by site().