Skip to content

Reuse parsed vnStat period labels - #99

Merged
Snuffy2 merged 2 commits into
mainfrom
perf-vnstat-processing
Aug 8, 2026
Merged

Reuse parsed vnStat period labels#99
Snuffy2 merged 2 commits into
mainfrom
perf-vnstat-processing

Conversation

@Snuffy2

@Snuffy2 Snuffy2 commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Summary

Reuses parsed vnStat period labels while selecting current and prior metrics for each interface.

What Changed

  • Pre-parses daily and monthly labels once per interface.
  • Reuses those parsed values for current and prior period selection.
  • Preserves output shapes, timezone behavior, and malformed-label fallbacks.
  • Added assertions proving labels are not parsed repeatedly.

Why

vnStat summaries selected multiple daily and monthly periods by reparsing the same row labels, multiplying strptime work as the interface and history counts grow.

Greptile Summary

Reuses daily and monthly vnStat labels parsed once per interface while retaining existing period-selection behavior.

  • Passes cached daily and monthly labels into current and prior period selectors.
  • Adds assertions covering parser call counts and selector edge cases.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
aiopnsense/vnstat.py Pre-parses daily and monthly labels per interface and reuses the aligned values during metric-row selection without changing reachable output behavior.
tests/test_vnstat.py Verifies labels are parsed once per row and adds coverage for unsupported day offsets and cross-year month selection.

Reviews (2): Last reviewed commit: "test: cover vnstat selector edge paths" | Re-trigger Greptile

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Snuffy2, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 39 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: bfa5550c-a33b-4682-af51-e01ee0b11b90

📥 Commits

Reviewing files that changed from the base of the PR and between b08bb21 and d9928c8.

📒 Files selected for processing (2)
  • aiopnsense/vnstat.py
  • tests/test_vnstat.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  aiopnsense
  vnstat.py
Project Total  

This report was generated by python-coverage-comment-action

@read-the-docs-community

read-the-docs-community Bot commented Aug 8, 2026

Copy link
Copy Markdown

Documentation build overview

📚 aiopnsense | 🛠️ Build #33975721 | 📁 Comparing d9928c8 against latest (b08bb21)

  🔍 Preview build  

1 file changed
± _modules/aiopnsense/vnstat.html

@Snuffy2

Snuffy2 commented Aug 8, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: d9928c8fca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Snuffy2
Snuffy2 merged commit d57d2db into main Aug 8, 2026
13 checks passed
@Snuffy2
Snuffy2 deleted the perf-vnstat-processing branch August 8, 2026 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant