Skip to content

Perf: speed up client-side queue filtering in job list#369

Open
dapineyro wants to merge 6 commits into
mainfrom
filter_queue_perf_improvement
Open

Perf: speed up client-side queue filtering in job list#369
dapineyro wants to merge 6 commits into
mainfrom
filter_queue_perf_improvement

Conversation

@dapineyro

Copy link
Copy Markdown
Collaborator
  • Scan with the API maximum page size (100) instead of --page-size
  • Always scan from the first API page so client-side pagination is complete
  • Reuse a single HTTP session across the scan (new create_retry_session util)
  • Print scan progress so the command never looks frozen
  • Bump version to 2.95.1

Overview

Does this

JIRA

Please add here as many related tasks this PR covers with its brief description, if more than one ticket

Changes

  • Implements X
  • Refactors Y
  • Adds/Removes Z

Acceptance Criteria

Please add here as many scenarios as in the Story

Normally this acceptance criteria is tested in ADAPT workspace in PROD

Scenario 1 - proof this scenario passes
Scenario 2 - proof this scenario passes
Scenario X - proof this scenario passes

DEV

This Environment is interchangable with PROD if the acceptance criteria can only be tested in DEV for example. If that is the case please name this section PROD (or any new environment)

Proof this feature/patch works in this environment

AZURE

Proof this feature/patch works in this environment

Interactive Analysis

Proof this feature/patch works in this environment

Copilot AI review requested due to automatic review settings July 16, 2026 16:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR improves cloudos job list --filter-queue behavior and perceived responsiveness by scanning jobs client-side more efficiently and reusing HTTP connections, with corresponding documentation and versioning updates.

Changes:

  • Add create_retry_session() and allow retry_requests_get() to reuse a provided session.
  • Update Cloudos.get_job_list() to scan from API page 1 with limit=100 when queue filtering, reuse a session, and print scan progress.
  • Add/extend tests and update docs/changelog; bump version to 2.95.1.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
cloudos_cli/utils/requests.py Introduces reusable retry-enabled session utility and threads it into request helpers.
cloudos_cli/clos.py Implements client-side full-scan queue filtering with max page size, session reuse, and progress output.
tests/test_utils/test_requests.py Adds tests for retry session creation and session reuse in retry_requests_get.
tests/test_clos/test_get_job_list_filtering.py Adds tests verifying queue filtering scans from page 1 with limit=100 and aggregates across pages.
README.md Documents client-side queue filtering and scan progress behavior.
CHANGELOG.md Notes the queue-filter scan behavior changes and fixes.
cloudos_cli/_version.py Bumps package version to 2.95.1.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cloudos_cli/clos.py
Comment thread cloudos_cli/clos.py Outdated
Comment thread tests/test_utils/test_requests.py Outdated
Comment thread tests/test_utils/test_requests.py Outdated
Comment thread cloudos_cli/utils/requests.py Outdated
Comment thread cloudos_cli/clos.py
- Scan with the API maximum page size (100) instead of --page-size
- Always scan from the first API page so client-side pagination is complete
- Reuse a single HTTP session across the scan (new create_retry_session util)
- Print scan progress so the command never looks frozen
- Bump version to 2.95.1
@dapineyro
dapineyro force-pushed the filter_queue_perf_improvement branch from eb70d3f to 3823926 Compare July 16, 2026 16:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Comment thread cloudos_cli/utils/requests.py Outdated
Comment thread cloudos_cli/clos.py Outdated
Comment thread cloudos_cli/clos.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Comment thread cloudos_cli/clos.py Outdated
Comment thread cloudos_cli/utils/requests.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Comment thread cloudos_cli/utils/requests.py Outdated
Comment thread cloudos_cli/utils/requests.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.

Comment thread cloudos_cli/jobs/cli.py
Comment on lines 1328 to +1333
fetch_page = create_client_pagination_callback(my_jobs_r, page_size)

# Show first page of filtered results
first_page_jobs = my_jobs_r[:page_size]
first_page_metadata = {
'Pagination-Count': len(my_jobs_r),
'Pagination-Page': 1,
'Pagination-Limit': page_size
}
create_job_list_table(first_page_jobs, cloudos_url, first_page_metadata, selected_columns, fetch_page_callback=fetch_page)

# Show the requested page of filtered results
initial_page = fetch_page(page)
create_job_list_table(initial_page['jobs'], cloudos_url, initial_page['pagination_metadata'],
selected_columns, fetch_page_callback=fetch_page)
Comment thread cloudos_cli/utils/requests.py Outdated
Comment on lines 65 to 68
if session is None:
session = create_retry_session(total, status_forcelist)
response = session.get(url, **kwargs)
return response
Comment thread cloudos_cli/utils/requests.py Outdated
Comment on lines 88 to 90
session = create_retry_session(total, status_forcelist)
response = session.post(url, **kwargs)
return response
Comment thread cloudos_cli/utils/requests.py Outdated
Comment on lines 110 to 112
session = create_retry_session(total, status_forcelist)
response = session.put(url, **kwargs)
return response
Comment thread cloudos_cli/utils/requests.py Outdated
Comment on lines +135 to +137
session = create_retry_session(total, status_forcelist, allowed_methods=["DELETE"])
response = session.delete(url, **kwargs)
return response No newline at end of file
return response
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