fix: reset per-run counters + timing each run (#246)#247
Merged
Conversation
CurrentItemCount / CurrentSkippedItemCount (and the StartedAt/Elapsed timing added in #144/#91) were cumulative for the lifetime of the instance — running the same instance twice continued counting from where the prior run ended. Each run now resets those to their initial state at enumeration start (extractor/transformer) or at LoadAsync invocation (loader), so a re-run reports the current run's figures rather than a cumulative total. All run overloads route through a reset-aware wrapper so the reset fires consistently under lazy enumeration. Kept in all three base classes (no shared base, per the decision on #246); the reset is private — no public API change. Contract documented on the CurrentItemCount XML docs; concurrent re-enumeration of one instance is stated as unsupported. Verified: full Release build clean across all TFMs (0 warnings); 234 tests pass (3 new per-run-reset tests across extractor/loader/transformer). Unblocks the ETL-Test-Kit idempotency contract tests (ETL-Test-Kit#15). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jun 25, 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.
Fixes the cumulative-across-runs behavior of the base-class counters. Closes #246.
Stacked on #244 (base
feature/report-timing) because it also resets theStartedAt/Elapsedtiming that #244 introduced — which had the same cumulative bug.Problem
CurrentItemCount/CurrentSkippedItemCountwere cumulative for the lifetime of the instance: running the same instance twice continued from where the prior run ended (N → 2N). The timing added in #144/#91 had the identical issue (StartedAtcaptured once,Elapsedever-growing), which would makeItemsPerSecondnonsensical on a re-run.Fix
Per the decisions on #246: reset on each run, kept in all three base classes (no shared base).
Each run resets the counters and the timing to their initial state:
ExtractAsync/TransformAsyncoverloads route through, so it fires lazily when the consumer begins enumerating, not at call time).LoadAsyncinvocation (the load isn't lazy).The reset is private — no public API change. The per-run contract is now documented on the
CurrentItemCountXML docs, and concurrent re-enumeration of a single instance is stated as unsupported (consistent with the one-shot Pipeline model).Verified
Unblocks the ETL-Test-Kit idempotency contract tests (Chris-Wolfgang/ETL-Test-Kit#15).
Part of: #154