9 #include <mach/clock.h>
10 #include <mach/mach.h>
11 #define GET_CLOCK_MONOTONIC(ts) \
13 clock_serv_t cclock; \
14 mach_timespec_t mts; \
15 host_get_clock_service(mach_host_self(), SYSTEM_CLOCK, &cclock); \
16 clock_get_time(cclock, &mts); \
17 mach_port_deallocate(mach_task_self(), cclock); \
18 ts.tv_sec = mts.tv_sec; \
19 ts.tv_nsec = mts.tv_nsec; \
22 #define GET_CLOCK_MONOTONIC(ts) \
23 clock_gettime(CLOCK_MONOTONIC, &ts);
27 using namespace XrdAdaptor;
30 : m_parent1(parent1), m_parent2(parent2)
43 int ms = 1000*(stop.tv_sec -
m_start.tv_sec) + (stop.tv_nsec -
m_start.tv_nsec)/1e6;
44 edm::LogVerbatim(
"XrdAdaptorInternal") <<
"Finished timer after " << ms << std::endl;
55 that.m_parent1 =
nullptr;
56 that.m_parent2 =
nullptr;
57 that.m_start = {0, 0};
78 : m_value(default_value),
81 m_interval0_start(now.tv_sec),
92 std::unique_lock<std::mutex> sentry(
m_mutex);
116 std::unique_lock<std::mutex> sentry(
m_mutex);
157 std::unique_ptr<QualityMetricSource>
190 std::unique_ptr<QualityMetricSource>
QualityMetric * m_parent1
std::unique_ptr< QualityMetricSource > newSource(timespec now)
QualityMetric(timespec now, int default_value=260)
QualityMetricUniqueSource & m_parent
void finishWatch(timespec now, int ms)
#define GET_CLOCK_MONOTONIC(ts)
static std::unique_ptr< QualityMetricSource > get(timespec now, const std::string &id)
QualityMetricSource(QualityMetricUniqueSource &parent, timespec now, int default_value)
QualityMetric * m_parent2
static QualityMetricFactory * m_instance
std::vector< std::vector< double > > tmp
void startWatch(QualityMetricWatch &)
void swap(QualityMetricWatch &)
static const unsigned interval_length
static std::string const source
QualityMetricUniqueSource(timespec now)