CMS 3D CMS Logo

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 &)
 
uint64_t getTotalBytes () const
 
std::chrono::nanoseconds getTotalReadTime ()
 
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< XrdReadStatisticsstartRead (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 78 of file XrdStatistics.h.

Constructor & Destructor Documentation

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

Definition at line 113 of file XrdStatistics.cc.

113  :
114  m_site(site),
115  m_readvCount(0),
116  m_chunkCount(0),
117  m_readvSize(0),
118  m_readvNS(0.0),
119  m_readCount(0),
120  m_readSize(0),
121  m_readNS(0)
122 {
123 }
std::string const & site() const
Definition: XrdStatistics.h:87
std::atomic< unsigned > m_readCount
std::atomic< uint64_t > m_readvSize
std::atomic< unsigned > m_readvCount
std::atomic< uint64_t > m_readvNS
std::atomic< uint64_t > m_readNS
std::atomic< uint64_t > m_readSize
std::atomic< unsigned > m_chunkCount
XrdAdaptor::XrdSiteStatistics::XrdSiteStatistics ( const XrdSiteStatistics )
delete

Member Function Documentation

void XrdSiteStatistics::finishRead ( XrdReadStatistics const &  readStats)

Definition at line 168 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().

169 {
170  if (readStats.readCount() > 1)
171  {
172  m_readvCount ++;
173  m_chunkCount += readStats.readCount();
174  m_readvSize += readStats.size();
175  m_readvNS += readStats.elapsedNS();
176  }
177  else
178  {
179  m_readCount ++;
180  m_readSize += readStats.size();
181  m_readNS += readStats.elapsedNS();
182  }
183 }
std::atomic< unsigned > m_readCount
std::atomic< uint64_t > m_readvSize
std::atomic< unsigned > m_readvCount
std::atomic< uint64_t > m_readvNS
std::atomic< uint64_t > m_readNS
std::atomic< uint64_t > m_readSize
std::atomic< unsigned > m_chunkCount
uint64_t XrdAdaptor::XrdSiteStatistics::getTotalBytes ( ) const
inline

Definition at line 97 of file XrdStatistics.h.

97 {return m_readvSize + m_readSize;}
std::atomic< uint64_t > m_readvSize
std::atomic< uint64_t > m_readSize
std::chrono::nanoseconds XrdAdaptor::XrdSiteStatistics::getTotalReadTime ( )
inline

Definition at line 98 of file XrdStatistics.h.

std::atomic< uint64_t > m_readvNS
std::atomic< uint64_t > m_readNS
boost::date_time::subsecond_duration< boost::posix_time::time_duration, 1000000000 > nanoseconds
XrdSiteStatistics& XrdAdaptor::XrdSiteStatistics::operator= ( const XrdSiteStatistics )
delete
void XrdSiteStatistics::recomputeProperties ( std::map< std::string, std::string > &  props)

Definition at line 152 of file XrdStatistics.cc.

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

153 {
154  props.clear();
155 
156  props["readv-numOperations"] = i2str(m_readvCount);
157  props["readv-numChunks"] = i2str(m_chunkCount);
158  props["readv-totalMegabytes"] = d2str(static_cast<float>(m_readvSize)/(1024.0*1024.0));
159  props["readv-totalMsecs"] = d2str(m_readvNS/1e6);
160 
161  props["read-numOperations"] = i2str(m_readCount);
162  props["read-totalMegabytes"] = d2str(static_cast<float>(m_readSize)/(1024.0*1024.0));
163  props["read-totalMsecs"] = d2str(static_cast<float>(m_readNS)/1e6);
164 }
std::atomic< unsigned > m_readCount
std::atomic< uint64_t > m_readvSize
static std::string d2str(double input)
std::atomic< unsigned > m_readvCount
std::atomic< uint64_t > m_readvNS
std::atomic< uint64_t > m_readNS
static std::string i2str(int input)
std::atomic< uint64_t > m_readSize
std::atomic< unsigned > m_chunkCount
std::string const& XrdAdaptor::XrdSiteStatistics::site ( ) const
inline

Definition at line 87 of file XrdStatistics.h.

References class-composition::parent.

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

Definition at line 126 of file XrdStatistics.cc.

References AlCaHLTBitMon_QueryRunRegistry::string, and XrdReadStatistics.

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

127 {
128  std::shared_ptr<XrdReadStatistics> readStats(new XrdReadStatistics(parent, req->getSize(), req->getCount()));
129  return readStats;
130 }

Friends And Related Function Documentation

friend class XrdReadStatistics
friend

Definition at line 80 of file XrdStatistics.h.

Referenced by startRead().

Member Data Documentation

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

Definition at line 104 of file XrdStatistics.h.

Referenced by finishRead(), and recomputeProperties().

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

Definition at line 107 of file XrdStatistics.h.

Referenced by finishRead(), and recomputeProperties().

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

Definition at line 109 of file XrdStatistics.h.

Referenced by finishRead(), and recomputeProperties().

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

Definition at line 108 of file XrdStatistics.h.

Referenced by finishRead(), and recomputeProperties().

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

Definition at line 103 of file XrdStatistics.h.

Referenced by finishRead(), and recomputeProperties().

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

Definition at line 106 of file XrdStatistics.h.

Referenced by finishRead(), and recomputeProperties().

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

Definition at line 105 of file XrdStatistics.h.

Referenced by finishRead(), and recomputeProperties().

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

Definition at line 101 of file XrdStatistics.h.