37 std::map<std::string, std::string> props;
39 stats->recomputeProperties(props);
45 std::vector<std::pair<std::string, XrdStatisticsService::CondorIOStats>>
result;
51 std::lock_guard<std::mutex>
lock(instance->
m_mutex);
52 result.reserve(instance->
m_sites.size());
60 result.emplace_back(ss->site(),
cs);
66 std::lock_guard<std::mutex>
lock(m_mutex);
67 for (
auto &
stats : m_sites) {
68 if (
stats->site() == site) {
80 if (m_instance.compare_exchange_strong(expected,
tmp.get())) {
87 return m_instance.load(std::memory_order_relaxed);
92 desc.
setComment(
"Report Xrootd-related statistics centrally.");
95 "True: Add per-site Xrootd statistics to the framework job report.\n" 96 "False: Collect no site-specific statistics.\n");
97 descriptions.
add(
"XrdAdaptor::XrdStatisticsService", desc);
111 std::shared_ptr<ClientRequest> req) {
112 std::shared_ptr<XrdReadStatistics> readStats(
new XrdReadStatistics(parent, req->getSize(), req->getCount()));
117 std::ostringstream formatter;
119 return formatter.str();
123 std::ostringstream formatter;
124 formatter << std::setw(4) <<
input;
125 return formatter.str();
133 props[
"readv-totalMegabytes"] =
d2str(static_cast<float>(
m_readvSize) / (1024.0 * 1024.0));
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);
155 : m_size(size), m_count(count), m_parent(parent), m_start(
std::chrono::high_resolution_clock::
now()) {}
T getUntrackedParameter(std::string const &, T const &) const
void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
XrdReadStatistics(const XrdReadStatistics &)=delete
boost::date_time::subsecond_duration< boost::posix_time::time_duration, 1000000000 > nanoseconds
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
std::atomic< unsigned > m_readCount
static PFTauRenderPlugin instance
unique_ptr< ClusterSequence > cs
void finishRead(XrdReadStatistics const &)
std::atomic< uint64_t > m_readvSize
static std::string d2str(double input)
std::vector< std::pair< std::string, CondorIOStats > > condorUpdate()
static std::string const input
void reportPerformanceForModule(std::string const &metricClass, std::string const &moduleName, std::map< std::string, std::string > const &metrics)
XrdSiteStatistics(std::string const &site)
void recomputeProperties(std::map< std::string, std::string > &props)
void setComment(std::string const &value)
static std::shared_ptr< XrdReadStatistics > startRead(std::shared_ptr< XrdSiteStatistics > parent, std::shared_ptr< ClientRequest > req)
std::atomic< unsigned > m_readvCount
XrdStatisticsService(const edm::ParameterSet &iPS, edm::ActivityRegistry &iRegistry)
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
uint64_t elapsedNS() const
std::atomic< uint64_t > m_readvNS
std::atomic< uint64_t > m_readNS
std::chrono::time_point< std::chrono::high_resolution_clock > m_start
unsigned long long uint64_t
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::chrono::nanoseconds transferTime
static std::string i2str(int input)
std::atomic< uint64_t > m_readSize
friend class XrdReadStatistics
std::atomic< unsigned > m_chunkCount