Skip to content
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 @@ -123,6 +123,11 @@ rules:
cache: true
labels:
table: "$1"
- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", name=\"pinot.broker.(\\w+)\\.queryTotalTimeMs\"><>(\\w+)"
name: "pinot_broker_queryTotalTimeMs_$2"
cache: true
labels:
table: "$1"
- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", name=\"pinot.broker.(\\w+)_(\\w+).serverMissingForRouting\"><>(\\w+)"
name: "pinot_broker_serverMissingForRouting_$3"
cache: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,11 @@ rules:
cache: true
labels:
table: "$1"
- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", name=\"pinot.broker.(\\w+)\\.queryTotalTimeMs\"><>(\\w+)"
name: "pinot_broker_queryTotalTimeMs_$2"
cache: true
labels:
table: "$1"
- pattern: "\"org.apache.pinot.common.metrics\"<type=\"BrokerMetrics\", name=\"pinot.broker.(\\w+)\\.reduce\"><>(\\w+)"
name: "pinot_broker_reduce_$2"
cache: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import org.apache.pinot.common.metrics.BrokerMeter;
import org.apache.pinot.common.metrics.BrokerMetrics;
import org.apache.pinot.common.metrics.BrokerQueryPhase;
import org.apache.pinot.common.metrics.BrokerTimer;
import org.apache.pinot.common.request.BrokerRequest;
import org.apache.pinot.common.request.Expression;
import org.apache.pinot.common.request.ExpressionType;
Expand Down Expand Up @@ -585,6 +586,8 @@ private BrokerResponseNative handleRequest(long requestId, String query, JsonNod
brokerResponse.setTimeUsedMs(totalTimeMs);
requestContext.setQueryProcessingTime(totalTimeMs);
augmentStatistics(requestContext, brokerResponse);
_brokerMetrics.addTimedTableValue(rawTableName, BrokerTimer.QUERY_TOTAL_TIME_MS, totalTimeMs,
TimeUnit.MILLISECONDS);

logBrokerResponse(requestId, query, requestContext, tableName, numUnavailableSegments, serverStats, brokerResponse,
totalTimeMs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public enum BrokerTimer implements AbstractMetrics.Timer {
ROUTING_TABLE_UPDATE_TIME(true),
CLUSTER_CHANGE_QUEUE_TIME(true), // metric tracking the freshness lag for consuming segments
FRESHNESS_LAG_MS(false),
QUERY_TOTAL_TIME_MS(false),

// The latency of sending the request from broker to server
NETTY_CONNECTION_SEND_REQUEST_LATENCY(false),
Expand Down