CMS 3D CMS Logo

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

#include <XrdStatistics.h>

Inheritance diagram for XrdAdaptor::XrdStatisticsService:
xrd_adaptor::XrdStatistics

Public Member Functions

std::vector< std::pair
< std::string, CondorIOStats > > 
condorUpdate () final
 
void postEndJob ()
 
 XrdStatisticsService (const edm::ParameterSet &iPS, edm::ActivityRegistry &iRegistry)
 
- Public Member Functions inherited from xrd_adaptor::XrdStatistics
 XrdStatistics ()
 
virtual ~XrdStatistics ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 36 of file XrdStatistics.h.

Constructor & Destructor Documentation

XrdStatisticsService::XrdStatisticsService ( const edm::ParameterSet iPS,
edm::ActivityRegistry iRegistry 
)

Definition at line 24 of file XrdStatistics.cc.

References edm::ParameterSet::getUntrackedParameter(), and edm::ActivityRegistry::watchPostEndJob().

24  {
26 
27  if (iPS.getUntrackedParameter<bool>("reportToFJR", false)) {
29  }
30 }
T getUntrackedParameter(std::string const &, T const &) const
void watchPostEndJob(PostEndJob::slot_type const &iSlot)

Member Function Documentation

std::vector< std::pair< std::string, XrdStatisticsService::CondorIOStats > > XrdStatisticsService::condorUpdate ( )
finalvirtual

Implements xrd_adaptor::XrdStatistics.

Definition at line 50 of file XrdStatistics.cc.

References xrd_adaptor::XrdStatistics::CondorIOStats::bytesRead, fwrapper::cs, edm::get_underlying_safe(), instance, CommonMethods::lock(), XrdAdaptor::XrdSiteStatisticsInformation::m_mutex, XrdAdaptor::XrdSiteStatisticsInformation::m_sites, mps_fire::result, contentValuesCheck::ss, dqmMemoryStats::stats, and xrd_adaptor::XrdStatistics::CondorIOStats::transferTime.

50  {
51  std::vector<std::pair<std::string, XrdStatisticsService::CondorIOStats>> result;
53  if (!instance) {
54  return result;
55  }
56 
57  std::lock_guard<std::mutex> lock(instance->m_mutex);
58  result.reserve(instance->m_sites.size());
59  for (auto &stats : instance->m_sites) {
60  CondorIOStats cs;
61  std::shared_ptr<XrdSiteStatistics> ss = get_underlying_safe(stats);
62  if (!ss)
63  continue;
64  cs.bytesRead = ss->getTotalBytes();
65  cs.transferTime = ss->getTotalReadTime();
66  result.emplace_back(ss->site(), cs);
67  }
68  return result;
69 }
static PFTauRenderPlugin instance
unique_ptr< ClusterSequence > cs
std::vector< edm::propagate_const< std::shared_ptr< XrdSiteStatistics > > > m_sites
Definition: XrdStatistics.h:64
constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
tuple result
Definition: mps_fire.py:311
static XrdSiteStatisticsInformation * getInstance()
void XrdStatisticsService::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 96 of file XrdStatistics.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::addUntracked(), submitPVResolutionJobs::desc, and edm::ParameterSetDescription::setComment().

96  {
98  desc.setComment("Report Xrootd-related statistics centrally.");
99  desc.addUntracked<bool>("reportToFJR", true)
100  ->setComment(
101  "True: Add per-site Xrootd statistics to the framework job report.\n"
102  "False: Collect no site-specific statistics.\n");
103  descriptions.add("XrdStatisticsService", desc);
104 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void setComment(std::string const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void XrdStatisticsService::postEndJob ( )

Definition at line 32 of file XrdStatistics.cc.

References instance, edm::Service< T >::isAvailable(), XrdAdaptor::XrdSiteStatisticsInformation::m_sites, edm::JobReport::reportPerformanceForModule(), and dqmMemoryStats::stats.

32  {
34  if (!reportSvc.isAvailable()) {
35  return;
36  }
37 
39  if (!instance) {
40  return;
41  }
42 
43  std::map<std::string, std::string> props;
44  for (auto &stats : instance->m_sites) {
45  stats->recomputeProperties(props);
46  reportSvc->reportPerformanceForModule(stats->site(), "XrdSiteStatistics", props);
47  }
48 }
static PFTauRenderPlugin instance
std::vector< edm::propagate_const< std::shared_ptr< XrdSiteStatistics > > > m_sites
Definition: XrdStatistics.h:64
void reportPerformanceForModule(std::string const &metricClass, std::string const &moduleName, std::map< std::string, std::string > const &metrics)
Definition: JobReport.cc:673
bool isAvailable() const
Definition: Service.h:40
static XrdSiteStatisticsInformation * getInstance()