Add common stats collection objects - #610
Open
will-langdale wants to merge 1 commit into
Open
Conversation
will-langdale
force-pushed
the
feat/pipe-stats
branch
2 times, most recently
from
July 7, 2026 15:13
6019565 to
eaadbd8
Compare
…mory and further collection Signed-off-by: DBT pre-commit check
will-langdale
force-pushed
the
feat/pipe-stats
branch
from
July 7, 2026 15:43
eaadbd8 to
7c056d9
Compare
will-langdale
marked this pull request as ready for review
July 7, 2026 15:46
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.
We need a more fine-grained method to collect DAG statistics, and a common method to log new ones. This introduces it.
Fixes #419
🛠️ Changes proposed in this pull request
Adds a maximally extensible and flexible statistics object who can provide methods that are both context managers or decorators, as needed.
The way this is achieved is:
DAGStats.timedecorator creates a_StatLoggertemplate. This is refreshed on each_StatLogger.__call__()._StatLoggeris a decorator, name andDAGStatsare inferred by introspectingself, and it logs against them. If they don't exist, it'll just print logs. Because of this it can work fine on standalone functions as well as DAGs_StatLoggeris a context manager, there's noselfto introspect, so you pass in the name and stats instance manually if you need 'em👀 Guidance to review
In tests, the patching pattern is non-standard for this repo, because I think it creates a significantly more concise and readable set of tests in this instance.
update.pydoesn't need the full logger object, so instead we use the adapter existing memory logging function. This function would also, one day, be perfect for_StatLoggerif we wish.🤖 AI declaration
AI written, human reviewed.
✅ Checklist: