DataSource.Postgres: move the history read out of PostgresDataProvider
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 72/100
Research direction
Start with SemiPlot/SemiPlot.DataSource.Postgres/PostgresDataProvider.cs and trace the listed history methods, then read PostgresHistoryReadTests.cs, ExplainPlanTests, and PostgresCompositionTests for the constraints on moving them. Move the history path into an internal reader constructed by the provider, preserving logging category, clock, exception mapping, and registrations. Done when both classes are under 300 lines, the architecture document names the reader, and dotnet test SemiPlot.slnx passes.
Written by the indexing model from the issue text.
Description
Problem
PostgresDataProvider (SemiPlot/SemiPlot.DataSource.Postgres/PostgresDataProvider.cs) is 600 lines against
the 300-line class limit in AGENTS.md. It holds four concerns: the realtime poll wiring, the pen catalogue read,
the archive extent read and the history read. The history read is the largest and the one that keeps growing:
QueryHistoryAsync (:123), ReadHistoryAsync (:199), LogHistoryRead (:246), BindLocalWindow
(:329), BindLocalBucketedWindow (:345), BucketFor (:367), ReadWindowAsync (:379),
ReadBucketedWindowAsync (:403), FillFreshTailAsync (:428), the row readers (:457-:482) and
HistoryReadOutcome (:594).
Proposed change
Move the history read into an internal type in SemiPlot.DataSource.Postgres (e.g. PostgresHistoryReader)
that PostgresDataProvider.QueryHistoryAsync delegates to. A pure refactor: no change to SQL, results, logging or
the IDataProvider surface.
Constraints
BindLocalWindow,BindLocalBucketedWindowandBucketForare called byExplainPlanTestsand
PostgresHistoryReadTests; they move with the reader and the tests follow.- The history-read log tests filter on the provider's logger category
(PostgresHistoryReadTests.cs:659,entry.Category == typeof(PostgresDataProvider).FullName). Either the
reader logs throughILogger<PostgresDataProvider>, or the category changes and the tests and the field-triage
text indocs/architecture/data-integration.mdfollow. PostgresCompositionTestsbuilds the provider directly and pins theAddPostgresDataregistrations; the reader
is constructed by the provider, not registered.- The fresh tail's clock (
TimeProvider) and the exception mapper go to the reader with the read.
Acceptance
PostgresDataProvider.csunder 300 lines; the reader under 300 lines.dotnet test SemiPlot.slnxgreen with no behaviour test changed beyond the moved member names.docs/architecture/data-integration.mdnames the reader where it names the provider's history path.
- Dominant language
- C#
- Stars
- 0
- Forks
- 0
- Avg merge
- 3h 25m
- Merged PRs (30d)
- 31
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Semiteq/SemiPlot
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
Maintainers usually reply within 1 day
-
Live data: show a value within 1 s of its changePossibly taken @mrcsin claimed this 7 days ago. Openbug enhancement
Semiteq/SemiPlot#116 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
Minimap: draw an envelope, bound the span, step with arrowsMay be free again @mrcsin claimed this 35 days ago, and no pull request is open. Openenhancement
Semiteq/SemiPlot#78 · 1 assignee ·
Maintainers usually reply within 1 day
-
Chart: time markers stored in the archiveMay be free again @mrcsin claimed this 35 days ago, and no pull request is open. Openenhancement
Semiteq/SemiPlot#77 · 1 assignee ·
Maintainers usually reply within 1 day
All issues in Semiteq/SemiPlot
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ClickHouse/clickhouse-cs#689 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 7 days
-
Difficulty 1/5 Under an hour Newbie friendliness 65/100
vchelaru/FlatRedBall2#1481 ·
Maintainers usually reply within 1 day
-
ai-chat bug trivial
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
area-signalr
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
dotnet/aspnetcore#69842 · 1 comment ·
Maintainers usually reply within 1 day