17 XrdStatistics::~XrdStatistics() {}
22 std::atomic<XrdSiteStatisticsInformation *> XrdSiteStatisticsInformation::m_instance;
25 XrdSiteStatisticsInformation::createInstance();
32 void XrdStatisticsService::postEndJob() {
43 std::map<std::string, std::string> props;
45 stats->recomputeProperties(props);
50 std::vector<std::pair<std::string, XrdStatisticsService::CondorIOStats>> XrdStatisticsService::condorUpdate() {
51 std::vector<std::pair<std::string, XrdStatisticsService::CondorIOStats>>
result;
64 cs.bytesRead =
ss->getTotalBytes();
65 cs.transferTime =
ss->getTotalReadTime();
71 std::shared_ptr<XrdSiteStatistics> XrdSiteStatisticsInformation::getStatisticsForSite(
std::string const &site) {
72 std::lock_guard<std::mutex>
lock(m_mutex);
73 for (
auto &
stats : m_sites) {
74 if (
stats->site() == site) {
82 void XrdSiteStatisticsInformation::createInstance() {
86 if (m_instance.compare_exchange_strong(expected,
tmp.get())) {
93 return m_instance.load(std::memory_order_relaxed);
98 desc.setComment(
"Report Xrootd-related statistics centrally.");
99 desc.addUntracked<
bool>(
"reportToFJR",
true)
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);
117 std::shared_ptr<ClientRequest> req) {
139 props[
"readv-totalMegabytes"] =
d2str(static_cast<float>(
m_readvSize) / (1024.0 * 1024.0));
143 props[
"read-totalMegabytes"] =
d2str(static_cast<float>(
m_readSize) / (1024.0 * 1024.0));
144 props[
"read-totalMsecs"] =
d2str(static_cast<float>(
m_readNS) / 1e6);
XrdReadStatistics(const XrdReadStatistics &)=delete
boost::date_time::subsecond_duration< boost::posix_time::time_duration, 1000000000 > nanoseconds
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
std::atomic< unsigned > m_readCount
static PFTauRenderPlugin instance
uint64_t elapsedNS() const
void finishRead(XrdReadStatistics const &)
constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
std::atomic< uint64_t > m_readvSize
static std::string d2str(double input)
static std::string const input
void reportPerformanceForModule(std::string const &metricClass, std::string const &moduleName, std::map< std::string, std::string > const &metrics)
T getUntrackedParameter(std::string const &, T const &) const
void recomputeProperties(std::map< std::string, std::string > &props)
std::chrono::time_point< std::chrono::steady_clock > m_start
static std::shared_ptr< XrdReadStatistics > startRead(std::shared_ptr< XrdSiteStatistics > parent, std::shared_ptr< ClientRequest > req)
std::atomic< unsigned > m_readvCount
std::atomic< uint64_t > m_readvNS
std::atomic< uint64_t > m_readNS
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
unsigned long long uint64_t
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static std::string i2str(int input)
std::atomic< uint64_t > m_readSize
friend class XrdReadStatistics
std::atomic< unsigned > m_chunkCount