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)
 
const std::string & site () const
 
 XrdSiteStatistics (const XrdSiteStatistics &)=delete
 
 XrdSiteStatistics (std::string const &site)
 

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 71 of file XrdStatistics.h.

Constructor & Destructor Documentation

◆ XrdSiteStatistics() [1/2]

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

Definition at line 100 of file XrdStatistics.cc.

101  : m_site(site),
102  m_readvCount(0),
103  m_chunkCount(0),
104  m_readvSize(0),
105  m_readvNS(0.0),
106  m_readCount(0),
107  m_readSize(0),
108  m_readNS(0) {}

◆ XrdSiteStatistics() [2/2]

XrdAdaptor::XrdSiteStatistics::XrdSiteStatistics ( const XrdSiteStatistics )
delete

Member Function Documentation

◆ finishRead()

void XrdSiteStatistics::finishRead ( XrdReadStatistics const &  readStats)

Definition at line 141 of file XrdStatistics.cc.

141  {
142  if (readStats.readCount() > 1) {
143  m_readvCount++;
144  m_chunkCount += readStats.readCount();
145  m_readvSize += readStats.size();
146  m_readvNS += readStats.elapsedNS();
147  } else {
148  m_readCount++;
149  m_readSize += readStats.size();
150  m_readNS += readStats.elapsedNS();
151  }
152 }

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().

◆ getTotalBytes()

uint64_t XrdAdaptor::XrdSiteStatistics::getTotalBytes ( ) const
inline

Definition at line 90 of file XrdStatistics.h.

90 { return m_readvSize + m_readSize; }

References m_readSize, and m_readvSize.

◆ getTotalReadTime()

std::chrono::nanoseconds XrdAdaptor::XrdSiteStatistics::getTotalReadTime ( )
inline

Definition at line 91 of file XrdStatistics.h.

References m_readNS, and m_readvNS.

◆ operator=()

XrdSiteStatistics& XrdAdaptor::XrdSiteStatistics::operator= ( const XrdSiteStatistics )
delete

◆ recomputeProperties()

void XrdSiteStatistics::recomputeProperties ( std::map< std::string, std::string > &  props)

Definition at line 128 of file XrdStatistics.cc.

128  {
129  props.clear();
130 
131  props["readv-numOperations"] = i2str(m_readvCount);
132  props["readv-numChunks"] = i2str(m_chunkCount);
133  props["readv-totalMegabytes"] = d2str(static_cast<float>(m_readvSize) / (1024.0 * 1024.0));
134  props["readv-totalMsecs"] = d2str(m_readvNS / 1e6);
135 
136  props["read-numOperations"] = i2str(m_readCount);
137  props["read-totalMegabytes"] = d2str(static_cast<float>(m_readSize) / (1024.0 * 1024.0));
138  props["read-totalMsecs"] = d2str(static_cast<float>(m_readNS) / 1e6);
139 }

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

◆ site()

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

Definition at line 79 of file XrdStatistics.h.

79 { return m_site; }

References m_site.

◆ startRead()

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

Definition at line 110 of file XrdStatistics.cc.

111  {
112  std::shared_ptr<XrdReadStatistics> readStats(new XrdReadStatistics(parent, req->getSize(), req->getCount()));
113  return readStats;
114 }

References class-composition::parent, and XrdReadStatistics.

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

Friends And Related Function Documentation

◆ XrdReadStatistics

friend class XrdReadStatistics
friend

Definition at line 72 of file XrdStatistics.h.

Referenced by startRead().

Member Data Documentation

◆ m_chunkCount

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

Definition at line 99 of file XrdStatistics.h.

Referenced by finishRead(), and recomputeProperties().

◆ m_readCount

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

Definition at line 102 of file XrdStatistics.h.

Referenced by finishRead(), and recomputeProperties().

◆ m_readNS

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

Definition at line 104 of file XrdStatistics.h.

Referenced by finishRead(), getTotalReadTime(), and recomputeProperties().

◆ m_readSize

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

Definition at line 103 of file XrdStatistics.h.

Referenced by finishRead(), getTotalBytes(), and recomputeProperties().

◆ m_readvCount

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

Definition at line 98 of file XrdStatistics.h.

Referenced by finishRead(), and recomputeProperties().

◆ m_readvNS

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

Definition at line 101 of file XrdStatistics.h.

Referenced by finishRead(), getTotalReadTime(), and recomputeProperties().

◆ m_readvSize

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

Definition at line 100 of file XrdStatistics.h.

Referenced by finishRead(), getTotalBytes(), and recomputeProperties().

◆ m_site

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

Definition at line 96 of file XrdStatistics.h.

Referenced by site().

d2str
static std::string d2str(double input)
Definition: XrdStatistics.cc:122
cond::time::nanoseconds
boost::date_time::subsecond_duration< boost::posix_time::time_duration, 1000000000 > nanoseconds
Definition: TimeConversions.h:16
XrdAdaptor::XrdSiteStatistics::m_readvNS
std::atomic< uint64_t > m_readvNS
Definition: XrdStatistics.h:101
XrdAdaptor::XrdSiteStatistics::m_chunkCount
std::atomic< unsigned > m_chunkCount
Definition: XrdStatistics.h:99
XrdAdaptor::XrdSiteStatistics::m_readvCount
std::atomic< unsigned > m_readvCount
Definition: XrdStatistics.h:98
XrdAdaptor::XrdSiteStatistics::XrdReadStatistics
friend class XrdReadStatistics
Definition: XrdStatistics.h:72
XrdAdaptor::XrdSiteStatistics::m_readNS
std::atomic< uint64_t > m_readNS
Definition: XrdStatistics.h:104
XrdAdaptor::XrdSiteStatistics::m_site
const std::string m_site
Definition: XrdStatistics.h:96
i2str
static std::string i2str(int input)
Definition: XrdStatistics.cc:116
XrdAdaptor::XrdSiteStatistics::m_readSize
std::atomic< uint64_t > m_readSize
Definition: XrdStatistics.h:103
XrdAdaptor::XrdSiteStatistics::m_readCount
std::atomic< unsigned > m_readCount
Definition: XrdStatistics.h:102
class-composition.parent
parent
Definition: class-composition.py:88
XrdAdaptor::XrdSiteStatistics::m_readvSize
std::atomic< uint64_t > m_readvSize
Definition: XrdStatistics.h:100
XrdAdaptor::XrdSiteStatistics::site
const std::string & site() const
Definition: XrdStatistics.h:79