28 return fName + kFieldSeperator + fUnit + kFieldSeperator + fDescription + kFieldSeperator + GetValueAsString();
33 return GetLocalCounter(
name) !=
nullptr;
39 for (
const auto &
c : fCounters) {
40 if (
c->GetName() ==
name)
49 std::string prefix = fName +
".";
50 if (
name.compare(0, prefix.length(), std::string_view(prefix)) != 0)
53 auto innerName =
name.substr(prefix.length());
54 if (
auto counter = GetLocalCounter(innerName))
57 for (
auto m : fObservedMetrics) {
58 auto counter =
m->GetCounter(innerName);
59 if (counter !=
nullptr)
69 output << fName <<
" metrics disabled!" << std::endl;
73 for (
const auto &
c : fCounters) {
74 output << prefix << fName << kNamespaceSeperator <<
c->ToString() << std::endl;
76 for (
const auto c : fObservedMetrics) {
83 for (
auto &
c: fCounters)
86 for (
auto m: fObservedMetrics)
92 fObservedMetrics.push_back(&observee);
A collection of Counter objects with a name, a unit, and a description.
const RNTuplePerfCounter * GetCounter(std::string_view name) const
Searches this object and all the observed sub metrics.
void ObserveMetrics(RNTupleMetrics &observee)
const RNTuplePerfCounter * GetLocalCounter(std::string_view name) const
Searches counters registered in this object only. Returns nullptr if name is not found.
bool Contains(const std::string &name) const
void Print(std::ostream &output, const std::string &prefix="") const
A performance counter with a name and a unit, which can be activated on demand.
std::string ToString() const
virtual ~RNTuplePerfCounter()
void Print(Option_t *option="") const override
Dump this marker with its attributes.