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

chore: extend RouteProvider trait with routes_stats() #629

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

nikolay-komarevskiy
Copy link
Contributor

@nikolay-komarevskiy nikolay-komarevskiy commented Jan 17, 2025

Description

RouteProvider trait is extended with a method to get useful metrics about the total number of routes and healthy number of routes.

/// Returns the total number of routes and healthy routes as a tuple.
///
/// - First element is the total number of routes available (both healthy and unhealthy)
/// - Second element is the number of currently healthy routes, or None if health status information is unavailable
///
/// A healthy route is one that is available and ready to receive traffic.
/// The specific criteria for what constitutes a "healthy" route is implementation dependent.
fn routes_stats(&self) -> (usize, Option<usize>);

How Has This Been Tested?

Unit tests were extended accordingly.

Checklist:

  • The title of this PR complies with Conventional Commits.
  • I have edited the CHANGELOG accordingly.
  • I have made corresponding changes to the documentation.

@nikolay-komarevskiy nikolay-komarevskiy force-pushed the komarevskiy/extend-route-provider-with-routes-stats branch from 84c8505 to bd59d8e Compare January 17, 2025 14:38
@nikolay-komarevskiy nikolay-komarevskiy marked this pull request as ready for review January 20, 2025 17:20
@nikolay-komarevskiy nikolay-komarevskiy requested a review from a team as a code owner January 20, 2025 17:20
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.

2 participants