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

[DCJ-457] Register a ThreadPoolTaskExecutor for Stairway as a Bean #187

Merged

Conversation

okotsopoulos
Copy link
Contributor

@okotsopoulos okotsopoulos commented Jul 1, 2024

Addresses

Partially addresses https://broadworkbench.atlassian.net/browse/DCJ-457

PRs will need to be merged in the following order:

  1. [DCJ-457] Stairway can be built with a provided ThreadPoolTaskExecutor stairway#149
  2. This PR
  3. A forthcoming TDR PR to update its TCL version

Summary of changes

Spring Boot services which leverage TCL to configure its Stairways will now have the backing threadpool automatically instrumented via Spring Boot Actuator and Micrometer.

No additional action is required for calling services to benefit from this change, other than updating their TCL and/or Stairway dependencies to latest.

Testing Strategy

Expanded unit tests.

Verified end-to-end behavior manually:

  • Publishing Stairway and TCL to my local Maven repository
  • Booting up TDR, with and without maxParallelFlights specified
  • Observed that stairwayExecutor metrics were automatically flowing through TDR's Actuator endpoint
  • Initiated a Stairway flight which succeeded. Executor occupancy was reflected in actuator metrics.

Example where TDR configured its maxParallelFlights to be 120, has one actively running flight, and one completed flight:

(base) okotsopo@wm111-e35 jade-data-repo % curl http://localhost:8080/actuator/prometheus | grep 'stairwayExecutor'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 87022  100 8executor_pool_core_threads{name="stairwayExecutor",} 120.0   0
7022    0     0  10.1M      0 --:--:-- --:--:-- --:--:-- 10.3M
executor_queue_remaining_tasks{name="stairwayExecutor",} 2.147483647E9
executor_completed_tasks_total{name="stairwayExecutor",} 1.0
executor_pool_size_threads{name="stairwayExecutor",} 2.0
executor_queued_tasks{name="stairwayExecutor",} 0.0
executor_pool_max_threads{name="stairwayExecutor",} 120.0
executor_active_threads{name="stairwayExecutor",} 1.0

Calling Spring Boot services which leverage TCL to configure its Stairways will now have the backing threadpool automatically instrumented via Spring Boot Actuator and Micrometer.

No additional action is required for calling services to benefit from this change, other than updating their TCL and/or Stairway dependencies to latest.
Copy link
Contributor

@nmalfroy nmalfroy left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Copy link

sonarcloud bot commented Jul 1, 2024

@okotsopoulos okotsopoulos marked this pull request as ready for review July 1, 2024 19:58
@okotsopoulos okotsopoulos requested a review from rtitle July 1, 2024 19:59
@okotsopoulos okotsopoulos merged commit a40f30f into develop Jul 1, 2024
2 checks passed
@okotsopoulos okotsopoulos deleted the okotsopo-DCJ-457-stairway-threadpooltaskexecutor branch July 1, 2024 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants