CMS 3D CMS Logo

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::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 }
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
T getUntrackedParameter(std::string const &, T const &) const

Member Function Documentation

◆ condorUpdate()

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

Implements xrd_adaptor::XrdStatistics.

Definition at line 50 of file XrdStatistics.cc.

References callgraph::cs, edm::get_underlying_safe(), instance, CommonMethods::lock(), mps_fire::result, contentValuesCheck::ss, and dqmMemoryStats::stats.

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
constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
static XrdSiteStatisticsInformation * getInstance()

◆ fillDescriptions()

void XrdStatisticsService::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 96 of file XrdStatistics.cc.

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

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 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ postEndJob()

void XrdStatisticsService::postEndJob ( )

Definition at line 32 of file XrdStatistics.cc.

References instance, edm::Service< T >::isAvailable(), 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
void reportPerformanceForModule(std::string const &metricClass, std::string const &moduleName, std::map< std::string, std::string > const &metrics)
Definition: JobReport.cc:722
static XrdSiteStatisticsInformation * getInstance()
bool isAvailable() const
Definition: Service.h:40