-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Allow getting metrics after the operator is closed #9615
Conversation
Does this relate to #8691 ? |
No, it's not related - we suggest this change to simplify the implementation when the metrics should be updated on |
b05d394
to
52b1ce8
Compare
Ping :) |
core/trino-main/src/main/java/io/trino/operator/WorkProcessorSourceOperatorAdapter.java
Show resolved
Hide resolved
52b1ce8
to
a6daa33
Compare
@@ -538,6 +538,7 @@ private void closeOperators(int lastOperatorIndex) | |||
operatorContext.getDriverContext().getTaskId()); | |||
} | |||
finally { | |||
workProcessorOperatorContext.metrics.set(operator.getMetrics()); |
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.
you should also set connectorMetrics
(if its first operator in pipeline) (+ test)
BTW: I think you can just modify io.trino.operator.WorkProcessorPipelineSourceOperator#workProcessorOperatorStateMonitor
method to report metrics after:
if (state.getType() == FINISHED) {
..
}
if
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.
you should also set
connectorMetrics
(if its first operator in pipeline) (+ test)
Thanks, added in 2c2aca64e9.
I think you can just modify
io.trino.operator.WorkProcessorPipelineSourceOperator#workProcessorOperatorStateMonitor
method
I am not sure, since closeOperators
is dropping the closed operators in the finally
clause:
trino/core/trino-main/src/main/java/io/trino/operator/WorkProcessorPipelineSourceOperator.java
Line 543 in 43e5836
workProcessorOperatorContext.operator = null; |
Please let me know if you meant to refactor
closeOperators
method as well.
In case the metrics are updated when close() is called, the metrics' handling code would be simpler.
a6daa33
to
d49ed1c
Compare
Rebased over latest |
Many thanks! |
In case the metrics are updated when close() is called, the metrics' handling code would be simpler.
Following #6232 (comment).