28 return fName + kFieldSeperator + fUnit + kFieldSeperator + fDescription + kFieldSeperator + GetValueAsString();
33 for (
const auto &
c : fCounters) {
34 if (
c->GetName() ==
name)
43 std::string prefix = fName +
".";
44 if (
name.compare(0, prefix.length(), std::string_view(prefix)) != 0)
47 auto innerName =
name.substr(prefix.length());
48 for (
const auto &
c : fCounters) {
49 if (
c->GetName() == innerName)
53 for (
auto m : fObservedMetrics) {
54 auto counter =
m->GetCounter(innerName);
55 if (counter !=
nullptr)
65 output << fName <<
" metrics disabled!" << std::endl;
69 for (
const auto &
c : fCounters) {
70 output << prefix << fName << kNamespaceSeperator <<
c->
ToString() << std::endl;
72 for (
const auto c : fObservedMetrics) {
73 c->Print(
output, prefix + fName +
".");
79 for (
auto &
c: fCounters)
82 for (
auto m: fObservedMetrics)
88 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. Returns nullptr if name is not found.
void ObserveMetrics(RNTupleMetrics &observee)
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()
static void output(int code)