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

Allow getting metrics after the operator is closed #9615

Merged
merged 1 commit into from
Nov 8, 2021

Conversation

rzeyde-varada
Copy link
Contributor

In case the metrics are updated when close() is called, the metrics' handling code would be simpler.

Following #6232 (comment).

@cla-bot cla-bot bot added the cla-signed label Oct 13, 2021
@findepi
Copy link
Member

findepi commented Oct 14, 2021

Does this relate to #8691 ?

@rzeyde-varada
Copy link
Contributor Author

rzeyde-varada commented Oct 17, 2021

No, it's not related - we suggest this change to simplify the implementation when the metrics should be updated on ConnectorPageSource#close.

@rzeyde-varada
Copy link
Contributor Author

Ping :)

@@ -538,6 +538,7 @@ private void closeOperators(int lastOperatorIndex)
operatorContext.getDriverContext().getTaskId());
}
finally {
workProcessorOperatorContext.metrics.set(operator.getMetrics());
Copy link
Member

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

Copy link
Contributor Author

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:


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.
@rzeyde-varada
Copy link
Contributor Author

Rebased over latest master.

@sopel39 sopel39 merged commit 320f82e into trinodb:master Nov 8, 2021
@sopel39 sopel39 mentioned this pull request Nov 8, 2021
12 tasks
@github-actions github-actions bot added this to the 365 milestone Nov 8, 2021
@rzeyde-varada rzeyde-varada deleted the metrics-after-close branch November 9, 2021 06:35
@rzeyde-varada
Copy link
Contributor Author

Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants