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

Improve cf apps with --no-stats and better error handling #2795

Merged
merged 2 commits into from
Feb 22, 2024

Conversation

johha
Copy link
Contributor

@johha johha commented Feb 19, 2024

Where this PR should be backported?

Description of the Change

Introduce --no-stats for cf apps

Fetching process stats requires a /stats request for each process.
If a space contains a large number apps or processes this slows down cf apps.
In case a user is not interested in stats the --no-stats flag can be helpful.

Handle ProcessNotFoundError in cf apps

As a user calls cf apps in a large space it might happen that a app
was deleted while the CLI is putting all the different information (processes, stats & routes) together.
This leads to a failing cf apps command.
This change prevents this by catching ProcessNotFoundError errors and returning nil instead.
Related to #2734

@johha johha changed the title Apps no stats Improve cf apps with --no-stats and better error handling Feb 19, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Fetching process stats requires a `/stats` request for each process.
If a space contains a large number apps or processes this slows down `cf apps`.
In case a user is not interested in stats the `--no-stats` flag can be helpful.
As a user calls `cf apps` in a large space it might happen that a app
was deleted while the CLI is putting all the different information (processes, stats & routes) together.
This leads to a failing `cf apps` command.
This change prevents this by catching `ProcessNotFoundError` errors and returning `nil` instead.
Related to cloudfoundry#2734
@johha johha marked this pull request as ready for review February 20, 2024 16:17
@moleske moleske requested review from a team February 22, 2024 04:31
@a-b a-b merged commit 0fc2173 into cloudfoundry:main Feb 22, 2024
13 checks passed
@a-b
Copy link
Member

a-b commented Feb 22, 2024

Thank you @johha for your contribution. We appreciate the quality of your commit and PR description.

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