Skip to content

Add sys.monitoring coverage agent - #3

Open
koltiradw wants to merge 1 commit into
TNO-S3:mainfrom
koltiradw:new-cov-agent
Open

koltiradw wants to merge 1 commit into
TNO-S3:mainfrom
koltiradw:new-cov-agent

Conversation

@koltiradw

Copy link
Copy Markdown

Introduce a second coverage backend based on Python 3.12+'s sys.monitoring API (branch coverage map, no third-party deps), shipped as sys-monitoring/sitecustomize.py (formerly test.py).

Restructure the repo so each backend lives in its own directory with a dedicated README:

  • coveragepy/: coverage.py/LCOV backend (formerly root sitecustomize.py)
  • sys-monitoring/: new sys.monitoring branch-coverage backend

The root README now only gives a general overview and links to both backend READMEs.

Introduce a second coverage backend based on Python 3.12+'s
sys.monitoring API (branch coverage map, no third-party deps), shipped
as sys-monitoring/sitecustomize.py (formerly test.py).

Restructure the repo so each backend lives in its own directory with a
dedicated README:

- coveragepy/: coverage.py/LCOV backend (formerly root sitecustomize.py)
- sys-monitoring/: new sys.monitoring branch-coverage backend

The root README now only gives a general overview and links to both
backend READMEs.
@ThomasTNO

Copy link
Copy Markdown
Member

Nice work @koltiradw. I am curious about performance differences in terms of throughput. How does your new approach compare to the old approach in terms of req/s?

@koltiradw

Copy link
Copy Markdown
Author

@ThomasTNO hi!
I need a little time to take the measurements. I’ll be back with the results.

@koltiradw

Copy link
Copy Markdown
Author

@ThomasTNO

Copy link
Copy Markdown
Member

So, in summary, 15 req/s --> 408 req/s. Awesome!

@grebnetiew, willing to take a look as well?

@ThomasTNO

Copy link
Copy Markdown
Member

One thing to have a look at is how much code we consider coverable. Can we also configure that for sys-monitoring?
e.g. coverage of original mode: coverage: 491/761 (64%), coverage of sys-monitoring: coverage: 91/65536 (0%)

Curious how the coverage differs and why (both total and hit blocks)

@ThomasTNO

Copy link
Copy Markdown
Member

I guess the total for sys-monitoring is currently not a real total but rather an overly large map of 2^16.

@koltiradw

koltiradw commented Aug 31, 2026 •

Copy link
Copy Markdown
Author

You're right! The difference from coveragepy is that sys-monitoring tracks only branches, not every line. The bitmap size is currently 65536, since I can’t calculate in advance how many events there will be in total, but you can set a custom value via an environment variable.

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.

2 participants