Reviewer cache monitoring: in-run emit + scheduled collector#57
Reviewer cache monitoring: in-run emit + scheduled collector#57kacper-mikolajczak wants to merge 3 commits into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
matkoson
left a comment
There was a problem hiding this comment.
.github/scripts/collect-cache-health.sh:39 @kacper-mikolajczak what happens if both creation=0 and read=0 (e.g., a run that didn't use the reviewer or had no cache)? The ratio defaults to 0%, which would look like a perfectly warm run. Should there be a distinction between "truly warm" and "no cache data"?
generated by an automated pr-review pipe, not written by a human. reply and tag the repo owner if it got something wrong.
A run that emits creation=0 read=0 (reviewer skipped or no usage-bearing turns) passed the parse guard, counted toward scanned/MIN_SAMPLE, and read as not-cold - diluting the cold fraction and masking regressions. Treat no cache activity as no data, not a warm sample.
|
@matkoson Good catch, this is a real gap. A run that emits One nuance on the wording: in the summary table such a run actually renders as Fixed in e34569e by dropping zero/zero runs before they're counted, so they neither hit [ -n "$c" ] && [ -n "$r" ] || continue
# no cache activity at all = no data, not a warm sample
[ "$c" -eq 0 ] && [ "$r" -eq 0 ] && continueThis keeps the sample to runs that genuinely exercised the cache. |
|
@kacper-mikolajczak #27 (comment) - an accident, apologies, but at least somewhat useful as it turnes out ^^ |
|
Haha no worries @matkoson! 😄 Your agent indeed made a proper remark here - thanks for accidental review ❤️ |
Stacked on the cache-prefix change so this diff is just the monitoring. Split into two parts so analysis/alerting lives out of the review hot path.
1. In-run (minimal) —
emit-cache-usage.shA tiny step in the reviewer workflow that parses the action's
execution_file(always written, noshow_full_output) and prints one counts-only line to the log:No message content → safe in public logs. No analysis, no threshold, no failure.
2. Out-of-band collector —
reviewer-cache-monitor.yml+collect-cache-health.shA scheduled workflow (hourly + manual dispatch) that:
claude-review.ymlruns, reads their logs (only — no artifacts/content), greps theCACHE_USAGEline,Tunables:
LOOKBACK(30),CACHE_CREATION_WARN_TOKENS(15K),COLD_ALERT_PCT(40),MIN_SAMPLE(10).Why this shape
echoper review, no per-run analysis.Validated locally: emit produces the line for warm (creation 1.4K / read 333K) and cold (creation 64K) execution files; collector parse + threshold logic checked; both workflows parse as valid YAML.