Skip to content

Portal async cleanup metrics for dashboard chart (#61) - #67

Merged
ewilliams0305 merged 11 commits into
mainfrom
61-portal---async-metrics
Oct 4, 2026
Merged

ewilliams0305 merged 11 commits into
mainfrom
61-portal---async-metrics

Conversation

@ewilliams0305

@ewilliams0305 ewilliams0305 commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Scribbly Pull Request

Description

Closes #61.

Replaces the dashboard's hardcoded chart data with live cleanup metrics from CacheCleanupAsyncProcessor:

  • Each cleanup pass captures items total, items serviced, removals by reason, and pass duration
  • Store TotalCount is maintained with interlocked updates to avoid Count scans
  • Metrics are published to a channel and consumed into an in-memory ring sized from IOptionsMonitor cleanup delay
  • Portal endpoint: GET /cubby/portal/metrics?from=&to=
  • Dashboard chart shows Items / Serviced / Removed, Resolution, time-range scaling, 30s polling, and Duration on hover

Demo

Chart tooltip with Duration

chart-tooltip-duration.mp4

Developers

@ewilliams0305

Type of change

  • New feature (non-breaking change that adds functionality)

Checklist

  • I have executed all the unit tests
  • I have compiled and executed the application
  • I have updated the documentation to reflect my changes

Github Issues

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

Capture each CacheCleanupAsyncProcessor pass, publish via a bounded
channel, aggregate in an in-memory store, and expose GET
/cubby/portal/metrics for the dashboard chart with resolution text.

Co-authored-by: Eric Williams <ewilliams0305@users.noreply.github.com>
@ewilliams0305 ewilliams0305 linked an issue Oct 4, 2026 that may be closed by this pull request
8 tasks
cursoragent and others added 10 commits October 4, 2026 22:03
Align host Cleanup.Delay with the resolution example used by the
dashboard chart (Sampled 60x per hour).

Co-authored-by: Eric Williams <ewilliams0305@users.noreply.github.com>
Use shorter time-range tick labels on the dashboard chart, and include
Capacity in host appsettings so portal option cards reflect the store size.

Co-authored-by: Eric Williams <ewilliams0305@users.noreply.github.com>
Pass from/to query params to /cubby/portal/metrics, refetch on range
changes, and bind layerchart xDomain to the selected window so Last Hour
through Last 3 Days actually rescale the axis.

Co-authored-by: Eric Williams <ewilliams0305@users.noreply.github.com>
Bind the timeline toggle to local state, navigate with ?range=, and
canonicalize missing/invalid ranges to Last Hour so the active control
and address bar stay aligned with the chart domain.

Co-authored-by: Eric Williams <ewilliams0305@users.noreply.github.com>
Derive ring capacity from IOptionsMonitor cleanup settings so shorter
sample delays retain more points for the 3-day portal window, and resize
the store when options reload.

Co-authored-by: Eric Williams <ewilliams0305@users.noreply.github.com>
Use a 10s sliding window with a zero-offset time provider so
Get_Known_Key_SlidingFutureEntry_* no longer flakes when Put/Get
spans more than 1ms of real time.

Co-authored-by: Eric Williams <ewilliams0305@users.noreply.github.com>
Refresh portal page data on an interval so cleanup chart points and
option cards stay current without a manual browser reload.

Co-authored-by: Eric Williams <ewilliams0305@users.noreply.github.com>
Include each sample's duration_ms on hover so the dashboard can surface
how long the async processor took to scan and evict entries.

Co-authored-by: Eric Williams <ewilliams0305@users.noreply.github.com>
@ewilliams0305
ewilliams0305 marked this pull request as ready for review October 4, 2026 23:45
@ewilliams0305
ewilliams0305 merged commit 8614e7b into main Oct 4, 2026
3 checks passed
@ewilliams0305
ewilliams0305 deleted the 61-portal---async-metrics branch October 5, 2026 00:21
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.

Portal - Async Metrics

2 participants