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

Question: How to get the coverage data for each incoming request on my web server. #1742

Open
AkashKumar7902 opened this issue Feb 5, 2024 · 2 comments
Labels
bug Something isn't working needs triage

Comments

@AkashKumar7902
Copy link

AkashKumar7902 commented Feb 5, 2024

consider a sample python application (https://github.com/keploy/samples-python/tree/main/django-postgres), I want to get the coverage data for each request coming to my server.

I am aware of dynamic-context, but that it is a different thing, it provides only one option (test_function).

@AkashKumar7902 AkashKumar7902 added bug Something isn't working needs triage labels Feb 5, 2024
@nedbat
Copy link
Owner

nedbat commented Feb 5, 2024

You might need to try using the Coverage API, using start() and stop() around the request, and then examining the data each time. When you say "each request" I don't know if you mean every single request being made, or each different kind of request?

@AkashKumar7902
Copy link
Author

AkashKumar7902 commented Feb 5, 2024

Hey @nedbat thanks for the response.

You might need to try using the Coverage API, using start() and stop() around the request, and then examining the data each time.

I am not sure how that can be done at the server side. I would be grateful for any insights.

Little background here: I want to develop a module that does this for any python server out there.

When you say "each request" I don't know if you mean every single request being made, or each different kind of request?

I meant every single API request being made to the server. In the context of sample app I linked in the issue description, it would mean any request which comes to the five endpoints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

2 participants