Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base extractor #522

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Base extractor #522

wants to merge 2 commits into from

Conversation

einarmo
Copy link
Contributor

@einarmo einarmo commented Mar 3, 2025

First take on a new base extractor class. Some more work goes into this in the next step, adding startup reporting and integrating things a bit more tightly, but this is a nice first draft that contains some of the core logic.

The base extractor has a few roles, currently:

  • It contains the config object, in the future it will also handle changes to config revision and restart.
  • It acts as an error reporter, for raw errors.
  • It manages "monitored tasks", which are essentially just C# Tasks. The idea is that if something fails in a background process, this needs to be properly reported to the extractor so that it can take appropriate action. Background tasks have a name, can be cancelled independently, and can be expected to end or not, so if a task ends without an error, the extractor can take appropriate action.
  • It also contains shutdown logic, which is highly customizable, since extractor implementations may want to shut components down in a specific order. In general, different parts of the process are supposed to be independently cancelled, so that graceful shutdown is possible.

As with the last iteration of the base extractor, it is intended to be used as a base class for user extractors.

@einarmo einarmo requested a review from a team as a code owner March 3, 2025 06:31
Copy link

codecov bot commented Mar 3, 2025

Codecov Report

Attention: Patch coverage is 78.94737% with 44 lines in your changes missing coverage. Please review.

Project coverage is 78.24%. Comparing base (8b44bc4) to head (b9c6f6c).

Files with missing lines Patch % Lines
ExtractorUtils/Unstable/BaseExtractor.cs 84.14% 9 Missing and 17 partials ⚠️
...ctorUtils/Unstable/Tasks/ExtractorTaskScheduler.cs 60.00% 11 Missing and 7 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #522      +/-   ##
==========================================
+ Coverage   78.10%   78.24%   +0.13%     
==========================================
  Files         123      124       +1     
  Lines       11541    11748     +207     
  Branches     1748     1782      +34     
==========================================
+ Hits         9014     9192     +178     
- Misses       1817     1823       +6     
- Partials      710      733      +23     
Files with missing lines Coverage Δ
ExtractorUtils/Unstable/Tasks/Errors.cs 97.43% <ø> (ø)
...ctorUtils/Unstable/Tasks/ExtractorTaskScheduler.cs 65.04% <60.00%> (-1.12%) ⬇️
ExtractorUtils/Unstable/BaseExtractor.cs 84.14% <84.14%> (ø)

... and 2 files with indirect coverage changes

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