Setuptools 70+ removed pkg_resources module which is required by
pytorch-lightning 1.7.7 (transitive dependency). Pinning to <70.0.0
ensures pkg_resources remains available.
Root cause: pytorch-lightning 1.7.7 is being pulled in as a
dependency and requires pkg_resources, but setuptools 82.0.0
no longer provides it.
fix: use cached_slide_count instead of from_cache boolean for accurate telemetry
Replace boolean from_cache flag with integer cached_slide_count to properly
track cache hits at the slide level instead of batch level. This fixes
incorrect average duration calculation for mixed batches (some cached,
some fresh slides).
Previous behavior:
- Mixed batch (3 cached, 7 fresh) with 70s duration was excluded from
average if any slide was cached
New behavior:
- Only fully cached batches (all slides cached) are excluded from average
- Mixed batches are correctly included in average duration
- Reports now show total cached slides and cache hit rate percentage
Changes:
- UsageEvent: from_cache (bool) -> cached_slide_count (int)
- TelemetryTracker: Updated session metrics to check if all slides cached
- UI: Track cached_slides and fresh_slides counters separately
- Reports: Show 'Cached slides: X' and 'Cache hit rate: Y%'
- Tests: Updated all tests to use new cached_slide_count field
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add from_cache boolean to UsageEvent so telemetry distinguishes cache
hits from fresh GPU analyses. Cached analyses are excluded from session
analysis_time_sec and from the report's average duration to avoid
skewing usage metrics.
- Add from_cache to UsageEvent dataclass
- Add from_cache parameter to TelemetryTracker.log_usage_event()
- Track and report cache hits in analyze_slides()
- Update telemetry report (text + HTML) with cached analysis count
- Add tests for all new functionality
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat: add user summary section to telemetry report
Show logged-in vs anonymous user counts and per-user breakdown
of analyses and slides in both text and HTML report formats.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat: add --skip-empty flag and comprehensive tests for telemetry report
Added --skip-empty flag to telemetry_report.py that skips sending
emails when reports have no data, useful for automated daily reports
that may not always have activity.
Changes:
- Added is_report_empty() function to check for empty reports
- Added --skip-empty CLI flag with documentation
- Created comprehensive test suite (34 tests) covering:
- Event loading from JSONL files
- Empty report detection
- Text and HTML report generation
- Email sending with SMTP configuration
- CLI argument parsing and integration
- End-to-end workflows
- Added test documentation in tests/telemetry/README_REPORT_TESTS.md
All 34 new tests pass, full test suite (298 tests) passes with no
regressions. Tests use mocked SMTP and temporary directories for
isolation.
Co-Authored-By: Claude (claude-sonnet-4.5) <noreply@anthropic.com>
Add HF dataset download support for telemetry reporting
- Add download_from_hf_dataset() method to TelemetryStorage for pulling
telemetry data from HuggingFace dataset repositories
- Add --hf-repo flag to telemetry_report.py to pull remote telemetry
- Use clean temp directory when --hf-repo is specified to avoid mixing
with local data
- Support running instances by falling back to heartbeat events when
no shutdown events exist
- Fix hourly rate fallback to use DEFAULT_HOURLY_RATE when stored rate is 0
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>