Repository navigation
fix(overview-metrics): count stale assets and orphan terms inside Egeria - #572
Merged
dwolfson merged 2 commits intoNov 9, 2026
Merged
Conversation
…orphan terms count while scanning Egeria cannot count by an update-time condition: a search condition reaches only an element's own properties, so `updateTime LT <cutoff>` counts 0 (checked live and in the postgres QueryBuilder). It does sort by update time, and startFrom is an offset into the repository's sorted rows. So stale_assets now finds the stale count as the offset of the first Asset updated at or after the cutoff: about log2(N/25) one-row reads plus one read of the last 25-row window, never a page of Assets. Both figures are in the repository population. Live as erinoverview: 287 of 37,568 Assets in 13.3 s, where 6.2.28 took 34.5 s to report "not measured". Hidden rows exactly at the cutoff, a failed read or an exhausted read budget give None plus a note (with the range). Distinct relationship ends cannot be counted natively, so orphan_glossary_terms keeps its SemanticAssignment scan; its slow viewer term count (13.5 s) now runs on its own thread while the scan pages: 22.6 s -> 16.8 s, same answer (984 of 1,061). Catalog Growth, Ownership and Governance were reviewed: none pages where a count would do (see the PR body). Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com> # Conflicts: # docs/release-notes/6.2.29.md
This was referenced Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stale Assets gives a real answer, from about log2(N) one-row reads instead of one capped page; Orphan Glossary Terms runs its slow viewer count alongside its scan. For pyegeria 6.2.29: the pyegeria half of the owner's "both" (native counts in pyegeria, plus a Portal cache) for the slow local-dashboard analytics.
Branch
fix/native-counts-dashboard-analyticsoff upstream/main 259ca15 (6.2.28). One commit: 1f7ec15. No Egeria writes. No version bump.What Egeria can and cannot count (checked in Java source and live, read-only)
updateTimeis in the header, so no search condition can test it.updateTime LT <cutoff>(andcreateTime, asdateorlong) answered 0, in the repository population.QueryBuilder,update_timeis only a sort column.OMRSRepositoryContentValidator.countMatchingHeaderPropertyValuesis equality-only, on the in-memory path.sequencingOrder: LAST_UPDATE_OLDEST.updateTimeis set at create, so no row lacks one.startFromis an offset into the repository's own sorted rows. Live, single-row pages at offsets 0–11 returned the same rows as one 12-row page, with empty pages at offsets 6, 8, 9 and 11: rows erinoverview cannot see keep their offsets.FindRelationshipRequestBodyfilters by end GUIDs and types, but it has no distinct or group-by. So "terms with at least one SemanticAssignment" still needs the relationship scan.Changes
stale_assets: bisection over update-time order (_rows_updated_before)MAX_BISECT_READS = 64.assetTotal, the native push-down count.assetTotalin the viewer population, which timed out at 30 s live.unmeasurednote, never a sample's figure):at_least.population="repository".staleCountgetsassetTotalas its basis.REPOSITORY_WORDS.not_measuredsentence names the hidden-rows case.orphan_glossary_terms: the two reads now run at oncecontextvars.copy_context(), so its note reaches the caller'srecording_unmeasured()) while the scan pages.Docs
docs/output-formats-and-report-specs.mdgains two paragraphs: Counting by update time (6.2.29) and Distinct relationship ends cannot be counted natively. The Scans and Population paragraphs now saystale_assetsmoved.docs/release-notes/6.2.29.md.Live before/after (read-only, as
erinoverview)Method:
qs-view-server, throughexec_report_spec(label, params={}), as the Coordinator measured.Checking 287:
Where the time goes now:
The next three (looked at; not changed)
asset_compositionis at 5, would make it about 2 s.ownershipCountalone could be a native count.byOwnerTypereadsownerTypeNamefrom each Ownership classification, an open set of values. A native count needs each value known in advance.governedCount,fullyGovernedandpartialZoneOnlycould be native counts, about 3 per call.byClassification(every classification on a governed element, includingAnchorsandUsageActivity, an open set) andtopZones(zone values) need the elements.Tests
uv run -p 3.13 pytest tests/micro-tests/(Python 3.13.2), JUnit counts: at 1f7ec15, 2,561 collected, 2,558 passed, 3 skipped, 0 failed.test_native_counts_dashboard.py. Every test fails on the old module excepttest_the_term_count_note_from_its_thread_reaches_the_caller, a control (checked). Its fake is a sorted repository: a list of update times, with None for a row the viewer cannot see, served fromstartFrominLAST_UPDATE_OLDESTorder.asOfTime, and the count is push-down.as_ofanchors the cutoff.test_capped_scans_not_counts.py: its twostale_assetsone-page tests are replaced by the above.Callableimport inoverview_metrics.py, pre-exists.Consumers (not changed here)
stale_assetsoutput shape is unchanged.staleCountis now a number where it was None on every catalog over 500 Assets, andassetTotalis now a repository count.countScope: "repository"label is now true ofstale_assets.orphan_glossary_termsstays viewer-scoped inside that payload, as before.Follow-ups (not changed here)
updateTime LT, would makestale_assetsone call. So would a distinct-end relationship count fororphan_glossary_terms.ai_ready_assetsanddrl_readiness_gatesstill read one Asset page, and are None +capped: trueon this catalog. The bisection does not apply: "has DataFlow" is not an order.Review
🤖 Generated with Claude Code