-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add new mse metrics #17419
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
Merged
Merged
Add new mse metrics #17419
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f61a619
Add new mse metrics
gortiz 470ad46
fix javadoc
gortiz e17146d
Improve getUnsafe performance
gortiz 9be631f
use consts instead of explicit literals
gortiz ed00ff3
Update pinot-common/src/main/java/org/apache/pinot/common/metrics/Bro…
gortiz 6777d7d
Fix new metrics not being global
gortiz ff469ee
Update MultiStageBrokerRequestHandler to use worker metadata list for…
gortiz 01cb4cf
Fix mocked tests
gortiz 409ea35
Remove unused import
gortiz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -92,6 +92,7 @@ | |||||||||||
| import org.apache.pinot.spi.env.PinotConfiguration; | ||||||||||||
| import org.apache.pinot.spi.exception.QueryErrorCode; | ||||||||||||
| import org.apache.pinot.spi.exception.QueryException; | ||||||||||||
| import org.apache.pinot.spi.metrics.PinotMeter; | ||||||||||||
| import org.apache.pinot.spi.query.QueryExecutionContext; | ||||||||||||
| import org.apache.pinot.spi.query.QueryThreadContext; | ||||||||||||
| import org.apache.pinot.spi.trace.QueryFingerprint; | ||||||||||||
|
|
@@ -136,6 +137,11 @@ public class MultiStageBrokerRequestHandler extends BaseBrokerRequestHandler { | |||||||||||
| protected final long _extraPassiveTimeoutMs; | ||||||||||||
| protected final boolean _enableQueryFingerprinting; | ||||||||||||
|
|
||||||||||||
| protected final PinotMeter _stagesStartedMeter = BrokerMeter.MSE_STAGES_STARTED.getGlobalMeter(); | ||||||||||||
| protected final PinotMeter _stagesFinishedMeter = BrokerMeter.MSE_STAGES_COMPLETED.getGlobalMeter(); | ||||||||||||
| protected final PinotMeter _opchainsStartedMeter = BrokerMeter.MSE_OPCHAINS_STARTED.getGlobalMeter(); | ||||||||||||
| protected final PinotMeter _opchainsCompletedMeter = BrokerMeter.MSE_OPCHAINS_COMPLETED.getGlobalMeter(); | ||||||||||||
|
|
||||||||||||
| public MultiStageBrokerRequestHandler(PinotConfiguration config, String brokerId, | ||||||||||||
| BrokerRequestIdGenerator requestIdGenerator, RoutingManager routingManager, | ||||||||||||
| AccessControlFactory accessControlFactory, QueryQuotaManager queryQuotaManager, TableCache tableCache, | ||||||||||||
|
|
@@ -581,10 +587,19 @@ private BrokerResponse query(QueryEnvironment.CompiledQuery query, long requestI | |||||||||||
| return new BrokerResponseNative(QueryErrorCode.EXECUTION_TIMEOUT); | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| int stageCount = dispatchableSubPlan.getQueryStageMap().size(); | ||||||||||||
| int opChainCount = dispatchableSubPlan.getQueryStageMap().values().stream() | ||||||||||||
|
Comment on lines
+590
to
+591
|
||||||||||||
| int stageCount = dispatchableSubPlan.getQueryStageMap().size(); | |
| int opChainCount = dispatchableSubPlan.getQueryStageMap().values().stream() | |
| Map<Integer, DispatchablePlanFragment> queryStageMap = dispatchableSubPlan.getQueryStageMap(); | |
| int stageCount = queryStageMap.size(); | |
| int opChainCount = queryStageMap.values().stream() |
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
The
BaseBrokerRequestHandlerclass already has an instance ofBrokerMetrics. We should use that here instead for better testability instead of the global singleton IMO.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.
The attribute in the parent class is actually final and initialized to the value used here (the one returned by
BrokerMetrics.get()).In general, the idea is to use
BrokerMetrics.get()whenever possible. We should also keep the meters as attributes, as I'm doing here, to speed up calls (since we don't need to look up the meter each time). InBaseBrokerRequestHandlerwe use the old pattern, where we have an attribute forBrokerMetricsbut look for the metric each time we need to modify it.