Begin Profiling Rework to move towards Modularity
Had to open a new PR but it is the same as #10935.
This PR introduces a new pragma custom_profiling_settings which accepts a path to a JSON file. The file can be used to turn on or off profiling settings when the profiling mode is set to JSON (PRAGMA enable_profiling = 'json';). If the pragma is not set, all profiling information will be included.
Currently, the settings are as follows:
- CPU Timing: The total CPU time spent by that operator and its children.
- Operator Cardinality: The number of rows returned by that operator
- Operator Timing: The time spent by that operator
- Extra Info: Any other information collected during the operation
An example of a custom profiling settings JSON file:
PRAGMA custom_profiling_settings='/path/to/settings.json'
{
"cpu_time":"true",
"operator_cardinality":"true",
}
The plan is to expand this feature to be able to include more settings in the future, as well as a new function in the C API that returns an object with the profiling information.
Waiting for https://github.com/duckdb/duckdb/pull/11082 to be merged
Waiting on https://github.com/duckdb/duckdb/pull/11868. @maiadegraaf, please ping me once this is ready for review!
https://github.com/duckdb/duckdb/pull/11868 has been superseded by https://github.com/duckdb/duckdb/pull/11998 so this should be unblocked now!
Still waiting on merging main into feature to unlock the new JSON features.
The CI failure seems unrelated.
Its because I changed the name of certain proponents in the profiling, I updated the script so should work from now on. Just fails in the CI on this PR.
Thanks!