Skip to content

Add streaming session separability assessment tool - #284

Draft
CodyCBakerPhD wants to merge 35 commits into
mainfrom
claude/lucid-goldberg-wk2967
Draft

Add streaming session separability assessment tool#284
CodyCBakerPhD wants to merge 35 commits into
mainfrom
claude/lucid-goldberg-wk2967

Conversation

@CodyCBakerPhD

Copy link
Copy Markdown
Collaborator

Summary

This PR introduces a new analysis tool (assess_streaming_sessions.py) that evaluates the separability of user sessions in streaming HTTP requests by analyzing inter-request intervals and testing candidate session timeout windows.

Key Changes

  • New script: assess_streaming_sessions.py — a standalone tool for assessing session separability in streaming (HTTP 206, download=0) requests
  • Data loading: Walks the extraction cache to collect streaming requests, with support for encrypted IP files
  • Interval analysis: Computes inter-request intervals per IP to identify natural temporal patterns
  • Session window evaluation: Tests candidate bin sizes (10 min, 30 min, 1 hr, 2 hr) by measuring the distribution of gaps between the last request in a bin and the next request from the same IP
  • Visualization: Generates a 2×5 plot showing:
    • Histogram and empirical CDF of inter-request intervals (log scale)
    • For each bin size: histogram and CDF of "gap-beyond-bin" distributions
    • Reference lines marking candidate session timeout thresholds
  • Summary statistics: Prints percentile breakdowns of inter-request intervals to guide session timeout selection

Implementation Details

  • Reuses the library's encryption utilities for decrypted IP file handling
  • Handles missing/malformed data gracefully with warnings
  • Uses log-scale visualizations to reveal bimodal distributions and natural clustering in request patterns
  • Gap-beyond-bin metric helps identify which timeout window best separates sessions (clean gap distributions indicate good separation)

https://claude.ai/code/session_015rd4wDp52P3Ryv3QqMJ4Z9

claude and others added 2 commits June 23, 2026 18:48
Produces histogram + CDF plots of inter-request intervals per IP (log scale)
and gap-beyond-bin distributions for 10min/30min/1hr/2hr candidate session
timeouts, to assess whether a natural dead-zone exists in the data that would
justify a formal 'view session' definition for streaming requests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015rd4wDp52P3Ryv3QqMJ4Z9
Comment thread analysis/assess_streaming_sessions.py
@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.58%. Comparing base (19b4929) to head (b706cca).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #284   +/-   ##
=======================================
  Coverage   78.58%   78.58%           
=======================================
  Files          41       41           
  Lines        1742     1742           
=======================================
  Hits         1369     1369           
  Misses        373      373           
Flag Coverage Δ
unittests 78.58% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

claude and others added 8 commits June 23, 2026 19:22
- --exclude-asset/--exclude-asset-file to drop bot-hammered testing assets
- Attribute guard-band intervals to assets/IPs, flag same-asset (bot) fraction
- Relabel 'decades' as 'orders of magnitude' to avoid time confusion
… testing_blobs.txt

- find_min_density_band: log-binned minimum-density valley (zero-density was
  degenerate at real data volumes) with per-bin profile and suggested T
- sweep_guard_bands: coarse log-spaced ambiguity sweep across 1m-7d with a
  visual bar so the valley is obvious end-to-end
- Commit scripts/testing_blobs.txt exclusion list of bot-dominated blobs
@CodyCBakerPhD CodyCBakerPhD self-assigned this Jul 1, 2026
CodyCBakerPhD and others added 8 commits July 1, 2026 16:40
Reproducible join of dandi-cache structural metrics (groups, datasets, Sackin
index), S3 asset sizes, and dandi/access-summaries request/download counts,
plus the three relationship figures and a correlation summary.

- build_dataset.py: fetch + join content-id -> (dandiset,path) -> access counts,
  and S3 HEAD for asset sizes, into a single CSV
- plot_relationships.py: structure pairplot, consumption-mode split, and
  size-vs-streaming with size-controlled partial for complexity
- README documenting sources, usage, and findings
- Allowlist 'sackin' in codespell (proper name, not a typo)
Explains why the binary-tree baseline behind the Sackin normalization is
inappropriate for high-fan-out HDF5 trees, and surveys degree-agnostic
alternatives (total cophenetic index, B1/B2 entropy, out-degree and depth
descriptors) with a size-conditioned standardization recommendation.
claude and others added 6 commits August 2, 2026 16:10
… empirical check to supplement

- build_dataset.py/plot_relationships.py: join and plot cophenetic index and
  out-degree caches (derivatives branch) in place of the binary-baseline Sackin
- Regenerate figures with cophenetic index (log-log); update N to 1,829
- White paper now features the total cophenetic index; Sackin-specific critique
  (binary baseline, negative values) and an empirical check (cophenetic/out-degree
  vs access match Sackin) moved to SUPPLEMENT_tree_metrics.md
- Commit a snapshot access_structure.csv for figure provenance
Document that S3 logs blend all access methods (web/API/ROS3/fsspec/Neurosift),
all logging as REST.GET.OBJECT, so meta-statistics cannot be partitioned by method
and streaming-request volume conflates interest with client chunking/caching —
reinforcing the session-based view unit over raw request counts.
… resilient

- build_dataset.py: retry transient network/5xx errors via a urllib3 Retry session
  (a ConnectionReset had killed the full run); route all GET/HEAD through it
- Full end-to-end rebuild: 4,493 files across 253 dandisets (was 1,829 overlap)
- plot_relationships.py: cophenetic panels on log-y; regenerate all three figures
- Update white paper / README / supplement numbers to the full-set values
  (size vs streaming +0.75, download fraction −0.37, orthogonality −0.11, etc.)
- Refresh committed snapshot access_structure.csv
claude and others added 9 commits August 10, 2026 17:19
… mode to session analysis

- analysis/visitor_threshold_findings.md: no request-count valley exists;
  recommend number_of_viewers = unique IPs with >=1 streaming session (categorical
  stream-vs-not split) alongside the total unique-requester count
- assess_streaming_sessions.py --per-asset: compute gaps within each (IP, asset)
  group to recalibrate the session timeout on the scope the per-asset
  number_of_views metric actually uses (vs the cross-asset calibration)
…subsection to white paper

- assess_streaming_sessions.py: in --per-asset mode the same-asset fraction is a
  tautology (always 100%), so stop labeling it a 'bot signature'; report only the
  top contributing (candidate-bot) assets
- White paper 2.3: same-asset gap distribution is diurnal-dominated (no sub-hour
  valley; GA's 30 min does not transfer), 8h sits near an ambiguity peak under the
  per-asset scope, but the view is heavily periodic-bot contaminated so exact
  peak/valley locations are preliminary pending expanded bot exclusion
- Move uploaded session_assessment_per_asset.png into figures/
… label validation)

Scores every (IP, asset) time series for the metronomic monitoring signature
(gap CV + dominant-period fraction + persistence), and validates detection against
two ground-truth labels: DANDI testing datasets/assets and GitHub Actions IP
ranges (api.github.com/meta). Reports flagged-activity fraction, precision/recall
vs the labels, a CV-threshold sweep, and the top offenders.
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