Skip to content
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 some multi-stage metrics #12982

Merged
merged 4 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ protected BrokerResponse handleRequest(long requestId, String query, @Nullable S

DispatchableSubPlan dispatchableSubPlan = queryPlanResult.getQueryPlan();
Set<String> tableNames = queryPlanResult.getTableNames();

_brokerMetrics.addMeteredGlobalValue(BrokerMeter.MULTI_STAGE_QUERIES_GLOBAL, 1);
for (String tableName : tableNames) {
_brokerMetrics.addMeteredTableValue(tableName, BrokerMeter.MULTI_STAGE_QUERIES, 1);
}

requestContext.setTableNames(List.copyOf(tableNames));

// Compilation Time. This includes the time taken for parsing, compiling, create stage plans and assigning workers.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,26 @@ public enum BrokerMeter implements AbstractMetrics.Meter {
UNCAUGHT_POST_EXCEPTIONS("exceptions", true),
HEALTHCHECK_BAD_CALLS("healthcheck", true),
HEALTHCHECK_OK_CALLS("healthcheck", true),
/**
* Number of queries executed.
* <p>
* At this moment this counter does not include queries executed in multi-stage mode.
*/
QUERIES("queries", false),
/**
* Number of multi-stage queries that have been started.
* <p>
* Unlike {@link #MULTI_STAGE_QUERIES}, this metric is global and not attached to a particular table.
* That means it can be used to know how many multi-stage queries have been started in total.
*/
MULTI_STAGE_QUERIES_GLOBAL("queries", true),
/**
* Number of multi-stage queries that have been started touched a given table.
* <p>
* In case the query touch multiple tables (ie using joins)1, this metric will be incremented for each table, so the
* sum of this metric across all tables should be greater or equal than {@link #MULTI_STAGE_QUERIES_GLOBAL}.
*/
MULTI_STAGE_QUERIES("queries", false),

// These metrics track the exceptions caught during query execution in broker side.
// Query rejected by Jersey thread pool executor
Expand Down
Loading