[ntuple] Add ROOT_EXPERIMENTAL_EXPORT_RNTUPLE_METRICS - #23110
Open
albfsg wants to merge 3 commits into
Open
Conversation
The export path was memoized in a local static variable, so it was fixed by the first call and ignored later changes. I triggered this bug when needed to set ROOT_EXPORT_RNTUPLE_METRICS via gSystem->Setenv().
albfsg
requested review from
bellenot,
dpiparo,
jblomer and
silverweed
as code owners
August 19, 2026 12:07
Introduce a new environment variable to allow the user to state its intention to activate metrics and where to store them in a usable way which doesn't require source code modifications. If the environment variable `ROOT_EXPORT_RNTUPLE_METRICS` is set, metrics are automatically: - Enabled on construction, and any counter added afterwards through MakeCounter() is enabled as well. - Stored in the `.root` file path (relative or absolute) set by `ROOT_EXPORT_RNTUPLE_METRICS` on destruction The generated .root file will contain one RNTuple for each component with its metrics enabled. Each RNTuple will have a flat schema consisting of fully qualified counter names, such as RPageSinkFile_timeCpuZip. There is one entry per counter, which means if a counter appears more than once in a given RNTuple, all instances will be merged. Comes with a unit test. Modifies the output of the integration test roottest-root-ntuple-metrics-metrics_env_enabled, as the implementation of the automatic metrics storage uses the RNTupleMerger under the hood, which triggers a warning message.
albfsg
force-pushed
the
metrics_expansion
branch
from
August 19, 2026 12:10
b6c0db4 to
da685c9
Compare
albfsg
force-pushed
the
metrics_expansion
branch
from
August 19, 2026 12:50
da685c9 to
5a22dd7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This Pull request:
Changes or fixes:
ROOT_EXPORT_RNTUPLE_METRICSintoROOT_EXPERIMENTAL_EXPORT_RNTUPLE_METRICSGetMetricsExportPathROOT_EXPERIMENTAL_EXPORT_RNTUPLE_METRICSto a .root file automatically enables the metrics and saves them in the .root file.Checklist:
This PR fixes #
None