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

GEODE-7184: Add function execution timers #4135

Merged

Conversation

aaronlindsey
Copy link

  • Add micrometer timers for recording function executions
  • Refactor FunctionStats and FunctionServiceStats

Co-authored-by: Aaron Lindsey alindsey@pivotal.io
Co-authored-by: Kirk Lund klund@apache.org
Co-authored-by: Dale Emery demery@pivotal.io
Co-authored-by: Mark Hanson mhanson@pivotal.io


Thank you for submitting a contribution to Apache Geode.

In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:

For all changes:

  • Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?

  • Has your PR been rebased against the latest commit within the target branch (typically develop)?

  • Is your initial contribution a single, squashed commit?

  • Does gradlew build run cleanly?

  • Have you written or updated unit tests to verify your changes?

  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?

Note:

Please ensure that once the PR is submitted, check Concourse for build issues and
submit an update to your PR as soon as possible. If you need help, please send an
email to dev@geode.apache.org.

Aaron Lindsey and others added 3 commits October 8, 2019 16:15
- Add micrometer timers for recording function executions
- Refactor FunctionStats and FunctionServiceStats

Co-authored-by: Aaron Lindsey <alindsey@pivotal.io>
Co-authored-by: Kirk Lund <klund@apache.org>
Co-authored-by: Dale Emery <demery@pivotal.io>
Co-authored-by: Mark Hanson <mhanson@pivotal.io>
- Change static fields to instance fields on FunctionStatsManager
- Mark static field as @immutable on NoopMeterRegistry

Authored-by: Aaron Lindsey <alindsey@pivotal.io>
- Remove unused/unnecessary code
- Fix warnings

Authored-by: Aaron Lindsey <alindsey@pivotal.io>
@aaronlindsey aaronlindsey marked this pull request as ready for review October 9, 2019 18:19
Aaron Lindsey added 2 commits October 9, 2019 11:27
Authored-by: Aaron Lindsey <alindsey@pivotal.io>
- Broken by refactor in previous commit

Authored-by: Aaron Lindsey <alindsey@pivotal.io>
Copy link
Contributor

@demery-pivotal demery-pivotal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I chimed in on one of Aaron's comments, and added another. I'd like to at least talk about these before approving.

Copy link
Contributor

@jhuynh1 jhuynh1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than double checking with user/dev lists (if needed), I think this looks good

- Rename FunctionServiceStats.endFunctionExecutionWithElapsedTime to
distinguish it from FunctionStats.endFunctionExecution which takes a
start time.
- Remove extra call to FunctionStats.getTime() in
MemberFunctionStreamingMessage and add boolean to prevent calling
endFunctionExecutionWithException before startFunctionExecution was
called.

Authored-by: Aaron Lindsey <alindsey@pivotal.io>
Copy link
Author

@aaronlindsey aaronlindsey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't merge this yet — it seems there might be a case where this doesn't record the correct times for function executions without a result.

Aaron Lindsey and others added 2 commits October 17, 2019 16:35
Functions with hasResult()=false execute asynchronously on an executor.
Previously, the instrumentation code recorded a successful function
execution after submitting a function to an executor, which is incorrect
because the function has not necessarily executed at that point. Now, we
record the execution time only after the function actually executes.

Co-authored-by: Aaron Lindsey <alindsey@pivotal.io>
Co-authored-by: Kirk Lund <klund@apache.org>
Authored-by: Aaron Lindsey <alindsey@pivotal.io>
@aaronlindsey
Copy link
Author

Please don't merge this yet — it seems there might be a case where this doesn't record the correct times for function executions without a result.

I believe this issue is fixed. See comment.

- Remove FunctionStats.getTime() in favor of returning the time from
FunctionStats.startFunctionExecution()
- Add static import for assertj Assertions

Authored-by: Aaron Lindsey <alindsey@pivotal.io>
@kirklund kirklund merged commit 75c6342 into apache:develop Oct 21, 2019
@kirklund kirklund deleted the GEODE-7184-add-function-executions-timer branch October 21, 2019 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants