Skip to content

Add the FinOps Database Resources tab to the web viewer (#4843) - #5041

Merged
erikdarlingdata merged 28 commits into
devfrom
feat/4843-finops-database-resources-tab
Oct 3, 2026
Merged

erikdarlingdata merged 28 commits into
devfrom
feat/4843-finops-database-resources-tab

Conversation

@erikdarlingdata

@erikdarlingdata erikdarlingdata commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

The web viewer's FinOps Database Resources tab now shows a table over get_finops view=database_resources (hours 24).

  • Rows: every database the read returns, up to 500, ordered by CPU, then I/O, then name. The notice says when there were more.
  • Columns: the 11 columns in the desktop grid's order (FinOpsTab.xaml): database, CPU, CPU %, logical reads, physical reads, logical writes, executions, I/O read MB, I/O write MB, I/O %, I/O stall. CPU and I/O stall use the ms format. Every key is one the view's rows entries emit.
  • No bands: the browser derives no band, colour or threshold.
  • Off this tab: the top lists, which belong to the Utilization tab.

The notice is built from the answer:

  • normally N databases, last H hours., or "1 database" for one;
  • when truncated is true, …; the top N of {database_count} databases by CPU, then I/O.

Empty, not-collected, error and aborted/auth states match the High Impact tab.

Remaining: the desktop's 1/4/12/24/168 h window picker. The web tab uses a fixed 24 h, and the notice states it.

Tests: a new class, FinOpsTabDatabaseResourcesPageTests, with 10 facts:

  • every shown column key is matched inside the DatabaseResourcesRow object only, and the count equals its 11 properties;
  • the full column order is pinned exactly;
  • the notice expressions are pinned exactly;
  • the exact read call is pinned. That last pin is a no-noise guard: a limit would cap only the top lists, which this tab doesn't show.

Verified at the head:

  • Builds: Darling.Tests and Lite.Tests build with 0 errors. The one Darling.Tests warning, CA1068, is in a file this PR doesn't touch, and dev has it too.
  • Classes: these pass:
    • FinOpsTabDatabaseResourcesPageTests 10/10
    • FinOpsDatabaseResourcesViewTests 3/3
    • FinOpsPageShellTests 23/23
    • ServerPageTabsTests 19/19
    • FinOpsTabHighImpactPageTests 7/7
    • the guards
  • REDs:
    • Against the stub, all but the import fact fail.
    • A column bound to avg_cpu_ms, a key only the top lists carry, fails the key pin and the order pin.
    • Swapping the shown count and the total in the notice fails the notice pin.

Refs #4843

SECTION: Added
ENTRY: - The web viewer's FinOps page gains the Database Resources tab ([#5041]) - per-database CPU, reads, writes, executions and file I/O for the server over the last 24 hours, with each database's share of the server's CPU and I/O, read from get_finops
REF: [#5041]: #5041

…ge (#4843)

FinOpsHealthCalculator moves to PerformanceMonitor.Darling.Storage.FinOps and a new FinOpsCost
helper carries the window budget, share, storage share and annual cost expressions the viewer
computed inline, with identical decimal results. Also corrects the FinOps row-model header.
…4843)

The SQL, a plain HighImpactQuery result and ReadAsync now live in Storage/FinOps, and HighImpactScorer works on that result. The viewer keeps its HighImpactQueriesSql alias, delegates to the reader and maps rows with HighImpactQueryRow.From. No figure changes: a live test pins the pre-move values on a seeded store.
A grouped per-server FinOps tool with a closed view set. Its first view,
high_impact, serves the high-impact query_hash aggregates with their
shares, impact score and a service-decided impact band.
The read route and the tool catalog now carry get_finops, so the high_impact
view answers over HTTP with the same body the MCP tool returns, and an unknown
view is refused with the tool's own 400 refusal. A live test compares the two
bodies on a seeded store; the dispatch row was checked by temporarily dropping
hours_back from it, which turned the parity fact red.
…store live classes; sweep Storage subfolders for command deadlines (#4843)
…ew lines with detail in the guide, a relative-path sweep check; count get_finops in the tool census and scan partial MCP classes as one source (#4843)
The viewer's copy had no callers left, and the two Storage copies were byte-identical. Both readers now call one internal helper.
… lists, both collectors for not_collected, a fuller guide, I/O-only and PostgreSQL seeds (#4843)

rows sorts by CPU, then I/O, then name, so ties never depend on SQL order. limit caps only the two top lists; rows has a fixed ceiling of 500. not_collected needs both query_stats and file_io_stats gated. The guide gains the empty-list, rollup, rounding and 24-hour notes, each pinned. Tests seed two I/O-only databases, a PostgreSQL-engine server, and neutral names.
…ase-resources-tab

# Conflicts:
#	Darling/Darling.Tests/EngineCapabilityMissTests.cs
#	Darling/Darling.Tests/McpToolsListBudget/DarlingMcpFinOpsTools.txt
… column order, I/O stall in ms, an exact notice pin (#4843)
@erikdarlingdata
erikdarlingdata marked this pull request as ready for review October 3, 2026 20:15
@erikdarlingdata
erikdarlingdata merged commit 433872d into dev Oct 3, 2026
21 of 22 checks passed
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