Skip to content

get_resource_semaphore: add interval_seconds beside sample_interval_seconds (#3653 item 17) - #4103

Merged
erikdarlingdata merged 1 commit into
devfrom
fix/3653-resource-semaphore-interval-seconds
Sep 24, 2026
Merged

erikdarlingdata merged 1 commit into
devfrom
fix/3653-resource-semaphore-interval-seconds

Conversation

@erikdarlingdata

Copy link
Copy Markdown
Owner

Part of #3653 (item 17 remainder).

What changed

Item 17's window_truncated rename shipped earlier (#3793). One crossed spelling remained: the fact
"the interval the deltas cover, null when unknowable" is published as interval_seconds by
get_latch_stats / get_spinlock_stats (both products), but as sample_interval_seconds (+
interval_known) by get_resource_semaphore. Per the house rule (add a wire field beside, never rename),
this PR adds interval_seconds next to sample_interval_seconds on get_resource_semaphore, on both
products:

  • Darling: Darling/PerformanceMonitor.Darling.Service/Mcp/DarlingMcpMemoryGrantTools.cs
  • Lite: Lite/Mcp/McpMemoryTools.cs

interval_seconds carries the exact same value as sample_interval_seconds
(r.SampleIntervalSeconds is > 0 ? r.SampleIntervalSeconds : null), including null for a restart-marker
row (stored 0) and a pre-column row (stored NULL). sample_interval_seconds and interval_known are
untouched. The two sites that publish the RAW stored column (0 when unknown) — DarlingMcpTrendTools.cs:188
and Lite/Mcp/McpPerfmonTools.cs:125 — were not touched; they're a different fact (the raw column, not the
null-when-unknowable derived one).

Description tail (after <<GUIDE>>, never the head): one sentence added to both products' identical
tails, naming the parity: "interval_seconds is the interval these deltas cover, null when it can't be
known — the same name the latch and spinlock tools use; sample_interval_seconds carries the same value and
is kept for existing readers." The heads (before <<GUIDE>>) are untouched and stay byte-identical between
products, so the tools/list budget pins (McpToolsListBudget/DarlingMcpMemoryGrantTools.txt and
McpToolsListBudget/McpMemoryTools.txt, get_resource_semaphore line) are unaffected — served length is
617 on both, unchanged. No #nnnn in the added text. These files sit outside the #3898 description fence,
and no #3898 PR is open (checked before editing).

Tests: extended the existing live-Postgres round-trip
(Darling.Tests.DarlingMcpMemoryGrantToolsLivePostgresTests, which plants a restart marker, a measured
(120s) row, and a pre-column NULL row across three pools) with interval_seconds assertions matching
sample_interval_seconds for all three, including null for the two unknowable cases. Added the mirrored
assertion on Lite's unit test (Lite.Tests.McpLatestSnapshotStampTests.GetResourceSemaphore_ReadsTheWindowBesideTheStampedSnapshot),
which seeds pre-column rows, asserting both fields read null there. No twin-parity census covers this
tool's payload keys directly, so no such file needed updating.

What I ran

  • dotnet build Darling/Darling.Tests/Darling.Tests.csproj -p:EnableWindowsTargeting=true — clean.
  • dotnet build Lite.Tests/Lite.Tests.csproj — clean (Lite.Tests does not execute on macOS; build-only per lane rules).
  • Targeted classes on Darling.Tests (Windows-desktop stripped from runtimeconfig for the run, restored after):
    DarlingMcpMemoryGrantToolsSurfaceAndSqlTests (13 passed), McpToolsListBudgetTests (5 passed, run 3x for
    stability), DarlingMcpMemoryGrantToolsLivePostgresTests against a throwaway
    timescale/timescaledb:2.28.1-pg18 container (port 55893, removed after) — 1 passed.
  • Full Darling.Tests suite, once: 13307 total, 214 failed, 714 skipped — the same 214 Windows-only
    failures reported as the dev baseline on this Mac (DarlingInstallLocationTests, TargetProviderTests,
    ViewerDrillDownTests, etc. — none in DarlingMcpMemoryGrantTools* or McpToolsListBudgetTests).

What I did NOT verify

  • Lite.Tests execution (WPF; CI-only per lane rules).
  • No live-Postgres run on the Lite side (Lite's twin test here is a DuckDB unit test, not gated on
    DARLING_TEST_PG).

CHANGELOG entry

  • get_resource_semaphore (Darling and Lite) now also publishes interval_seconds, the same
    null-when-unknowable interval fact get_latch_stats and get_spinlock_stats already use under that name,
    beside the existing sample_interval_seconds (kept for existing readers).

…econds (#3653 item 17)

One fact, one name on the null-when-unknowable sites: get_latch_stats and get_spinlock_stats
publish the interval the deltas cover as interval_seconds; get_resource_semaphore published
the same fact as sample_interval_seconds. Adds interval_seconds beside it on both products
(Darling and Lite), same value, same null-on-restart-marker/pre-column rule. sample_interval_seconds
and interval_known are unchanged. Sites that publish the RAW stored column (0 when unknown) are
untouched.

Description tail (after <<GUIDE>>) gets one sentence naming the parity on both products; the
served heads (before <<GUIDE>>) are untouched, so the tools/list budget pins are unaffected.
@erikdarlingdata
erikdarlingdata marked this pull request as ready for review September 24, 2026 02:04
@erikdarlingdata
erikdarlingdata enabled auto-merge (squash) September 24, 2026 02:04
@erikdarlingdata
erikdarlingdata merged commit bbd7eec into dev Sep 24, 2026
26 of 28 checks passed
@erikdarlingdata
erikdarlingdata deleted the fix/3653-resource-semaphore-interval-seconds branch September 24, 2026 02:17
erikdarlingdata added a commit that referenced this pull request Sep 24, 2026
* Add 48 buffered CHANGELOG entries in one splice

Adds 48 entries and 48 link refs (#4057, #4077, #4079, #4081, #4082, #4083, #4084, #4085, #4086, #4087, #4088, #4089, #4090, #4091, #4092, #4093, #4095, #4096, #4099, #4100, #4101, #4103, #4105, #4106, #4107, #4108, #4109, #4110, #4111, #4113, #4114, #4115, #4116, #4117, #4118, #4119, #4120, #4121, #4122, #4123, #4124, #4125, #4126, #4127, #4131, #4133, #4136, #4141). Each PR's entry was buffered, and this lands every entry whose PR was merged on origin/dev when it ran.

Entries found under a bare section line (none unless the old script ran again) move into the matching ### section, below the new entries.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QQh8LczP1HGLXQYAx4oTZC

* Changelog splice: add #4137's entry, which merged before the splice but was missed

#4137 (pg_plan_capture reads csvlog) merged at 05:57Z with a CHANGELOG entry section in its
body. It was neither spliced nor listed as needing no entry. Its entry goes under Fixed, right
after #4136's, and #4136's last sentence now points to it instead of saying plan capture is
unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NUU29PuGg9TUFBsACgZg2K

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.

1 participant