29 return fName + kFieldSeperator + fUnit + kFieldSeperator + fDescription + kFieldSeperator + GetValueAsString();
34 return GetLocalCounter(
name) !=
nullptr;
40 for (
const auto &
c : fCounters) {
41 if (
c->GetName() ==
name)
50 std::string prefix = fName +
".";
51 if (
name.compare(0, prefix.length(), std::string_view(prefix)) != 0)
55 if (
auto counter = GetLocalCounter(
innerName))
58 for (
auto m : fObservedMetrics) {
60 if (counter !=
nullptr)
70 output << fName <<
" metrics disabled!\n";
74 for (
const auto &
c : fCounters) {
75 output << prefix << fName << kNamespaceSeperator <<
c->ToString() <<
'\n';
77 for (
const auto c : fObservedMetrics) {
78 c->Print(output, prefix + fName +
".");
84 for (
auto &
c: fCounters)
87 for (
auto m: fObservedMetrics)
93 fObservedMetrics.push_back(&
observee);
98 static const std::string path = []() -> std::string {
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
R__EXTERN TSystem * gSystem
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.
static const std::string & GetMetricsExportPath()
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()
virtual const char * Getenv(const char *env)
Get environment variable.