CMS 3D CMS Logo

List of all members | Public Member Functions
XrdAdaptor::XrdStatisticsService Class Reference

#include <XrdStatistics.h>

Public Member Functions

void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
void postEndJob ()
 
 XrdStatisticsService (const edm::ParameterSet &iPS, edm::ActivityRegistry &iRegistry)
 

Detailed Description

Definition at line 34 of file XrdStatistics.h.

Constructor & Destructor Documentation

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

Definition at line 20 of file XrdStatistics.cc.

References XrdAdaptor::XrdSiteStatisticsInformation::createInstance(), edm::ParameterSet::getUntrackedParameter(), postEndJob(), and edm::ActivityRegistry::watchPostEndJob().

21 {
22  if (iPS.getUntrackedParameter<bool>("reportToFJR", false))
23  {
25  }
26 
28 }
T getUntrackedParameter(std::string const &, T const &) const
void watchPostEndJob(PostEndJob::slot_type const &iSlot)

Member Function Documentation

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

Definition at line 81 of file XrdStatistics.cc.

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

82 {
84  desc.setComment("Report Xrootd-related statistics centrally.");
85  desc.addUntracked<bool>("reportToFJR", true)
86  ->setComment("True: Add per-site Xrootd statistics to the framework job report.\n"
87  "False: Collect no site-specific statistics.\n");
88  descriptions.add("XrdAdaptor::XrdStatisticsService", desc);
89 }
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 31 of file XrdStatistics.cc.

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

Referenced by XrdStatisticsService().

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