Skip to content

fix(enhancement): Added per stream fps threshold logic - #236

Merged
sumanaga merged 8 commits into
intel-retail:mainfrom
rishika-y-gaur:I-235
Jul 27, 2026
Merged

fix(enhancement): Added per stream fps threshold logic#236
sumanaga merged 8 commits into
intel-retail:mainfrom
rishika-y-gaur:I-235

Conversation

@rishika-y-gaur

@rishika-y-gaur rishika-y-gaur commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Evaluate stream density per camera target FPS so mixed-camera ASC bundles stop only when each stream meets its own threshold.

Resolves: #235

PR Checklist

  • Added label to the Pull Request for easier discoverability and search
  • Commit Message meets guidelines as indicated in the URL https://github.com/intel-retail/performance-tools/blob/main/CONTRIBUTING.md
  • Every commit is a single defect fix and does not mix feature addition or changes
  • Unit Tests have been added for new changes
  • Updated Documentation as relevant to the changes
  • All commented code has been removed
  • If you've added a dependency, you've ensured license is compatible with repository license and clearly outlined the added dependency.
  • PR change contains code related to security
  • PR introduces changes that breaks compatibility with other modules (If YES, please provide details below)

What are you changing?

This PR updates stream-density stopping logic to use per-stream target FPS, so mixed-camera ASC bundles stop only when each stream meets its own threshold.

Issue this PR will close

close: #235

Anything the reviewer should know when reviewing this PR?

Per-stream pass/fail thresholds with hysteresis are now used instead of a single shared FPS target, and target FPS thresholds are taken from camera config JSON files.

Test Instructions if applicable

  • Use a camera config with different targetFps values per camera.
  • Run stream density benchmark.
  • Confirm each stream is checked against its own threshold before stopping.

If the there are associated PRs in other repositories, please link them here (i.e. intel-retail/performance-tools )

Evaluate stream density per camera target FPS so mixed-camera ASC bundles stop only when each stream meets its own threshold.

Resolves: intel-retail#235

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 updates the stream-density benchmark’s stopping/scaling logic so mixed-camera bundles are evaluated against per-stream target FPS thresholds (derived from a camera config JSON), rather than using one shared FPS target for all streams.

Changes:

  • Add camera-config JSON parsing to build a per-stream targetFps map.
  • Update pass/fail + hysteresis evaluation to use per-stream thresholds.
  • Adjust increment estimation to use an aggregate (mean) of per-stream targets.

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

Comment thread benchmark-scripts/stream_density.py
Comment thread benchmark-scripts/stream_density.py Outdated
Comment thread benchmark-scripts/stream_density.py Outdated
Comment thread benchmark-scripts/stream_density.py

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 2 out of 2 changed files in this pull request and generated 5 comments.

Comment thread benchmark-scripts/stream_density.py Outdated
Comment thread benchmark-scripts/stream_density.py
Comment thread benchmark-scripts/stream_density.py Outdated
Comment thread benchmark-scripts/stream_density.py Outdated
Comment thread benchmark-scripts/stream_density.py Outdated
rishika-y-gaur and others added 2 commits July 17, 2026 12:54
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

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 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread benchmark-scripts/stream_density.py
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

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 2 out of 2 changed files in this pull request and generated 3 comments.

Comment thread benchmark-scripts/stream_density.py
Comment thread benchmark-scripts/stream_density.py Outdated
Comment thread benchmark-scripts/stream_density_test.py Outdated
@rishika-y-gaur
rishika-y-gaur requested a review from Copilot July 20, 2026 08:54

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 2 out of 2 changed files in this pull request and generated 5 comments.

Comment thread benchmark-scripts/stream_density.py
Comment thread benchmark-scripts/stream_density.py
Comment thread benchmark-scripts/stream_density.py
Comment thread benchmark-scripts/stream_density.py
Comment thread benchmark-scripts/stream_density_test.py

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 2 out of 2 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

benchmark-scripts/stream_density.py:91

  • re.compile(...) runs on every call to build_per_stream_target_fps, even though the comment says it’s compiled once. Since this function is invoked every sampling window, cache the compiled regex (similar to the config cache) to avoid repeated compilation overhead.
    # Compile regex once (if needed for stream name parsing)
    stream_pattern = re.compile(r"pipeline_stream(\d+)")
    per_stream_targets = {}

Comment thread benchmark-scripts/stream_density.py
Comment thread benchmark-scripts/stream_density.py Outdated
@rishika-y-gaur
rishika-y-gaur requested a review from Copilot July 20, 2026 09:47

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 2 out of 2 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

benchmark-scripts/stream_density.py:90

  • The comment says "Compile regex once" but the regex is compiled on every call to build_per_stream_target_fps, which can be misleading when diagnosing performance behavior.
    # Compile regex once (if needed for stream name parsing)
    stream_pattern = re.compile(r"pipeline_stream(\d+)")

Comment thread benchmark-scripts/stream_density.py
@sumanaga
sumanaga merged commit 46fc94f into intel-retail:main Jul 27, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(Enhancement) Use-case density needs per-camera FPS thresholds

3 participants