-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Metrics Support in the CAPI #12498
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey! Thanks for the PR, this looks great! My comments are mostly structural and nits, I think functionality-wise this is good to go. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @maiadegraaf - this looks almost ready to go now from my side, I only had two minor comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good from my side - one minor comment
Thanks! |
Merge pull request duckdb/duckdb#12498 from maiadegraaf/metrics_capi
This PR adds six new functions to the CAPI to support recursive access to the profiling tree.
duckdb_profiling_info duckdb_get_profiling_info(duckdb_connection connection);
const char *duckdb_profiling_info_get_value(duckdb_profiling_info info, const char *key);
nullptr
is returned. The result must be freed withduckdb_free
.idx_t duckdb_profiling_info_get_child_count(duckdb_profiling_info info);
duckdb_profiling_info duckdb_profiling_info_get_child(duckdb_profiling_info info, idx_t index);
const char *duckdb_profiling_info_get_name(duckdb_profiling_info info);
duckdb_free
.const char *duckdb_profiling_info_get_query(duckdb_profiling_info info);
duckdb_free
.Node Structure
The top node contains the
QUERY_ROOT
, which holds the query, the overall metrics for the query, as well as its children. Every subsequent node is anOPERATOR
node which holds the operator name, the operator-specific metrics, and its children.See this file for an example on how to access the profiling tree using the above functions.
Note: The current CAPI profiling does not include detailed profiling.