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

WIP: Introduce trigger functionality #406

Open
wants to merge 1 commit into
base: 0.12.x
Choose a base branch
from

Conversation

bozanix
Copy link

@bozanix bozanix commented Jan 12, 2024

This PR enables users to use --start-with-trigger option to only profile requests that have ?RELI_PROFILE query parameter in them.

PR is still WIP, but I would like to get your general opinion on this feature.

@bozanix bozanix changed the title Introduced trigger functionality WIP: Introduce trigger functionality Jan 12, 2024
@bozanix bozanix marked this pull request as ready for review January 12, 2024 20:47
@sj-i
Copy link
Member

sj-i commented Jan 13, 2024

Thanks for taking your time!
I will take a closer look later.

@sj-i
Copy link
Member

sj-i commented Jan 16, 2024

@bohdanlopatkin
Hi! Sorry for the delay. I was busy to death.

I think the good thing about this project is that it is a customisable profiler for PHP programmers, but TBH I am surprised when someone other than me really does it. I hope you enjoy the experience of reading the memory of another process in a PHP script.

I would like to get your general opinion on this feature.

First I want to be sure about the purpose.

Being able to read the query string means that Reli is already analysing the target process. So, do you want to stop analysing the call stack early on to reduce the machine load on uninterested requests, or do you want to filter the profile output to only process the requests you are interested in?

In the latter case, I was thinking of adding a feature like --peek-var or --peak-global in phpspy, as well as a way to filter the trace output using regular expressions.

In the former case, this seems to be one valid idea. The overhead of getting the query string itself is a bit of concern, as the target is a C string and you have to read it one character at a time until the nul character appears. But it would probably be cheaper than getting the whole trace anyway.

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.

None yet

3 participants