Comments (7)
I will start to look into the code more in the detail this weekend 👍
from php-spx.
I'm sorry to say that since v0.2.0 google trace event format support has been dropped.
Turning on/off the extension via a user signal could be very useful, but such a feature is IMHO especially needed for non-dev environment and let's say production environment. So if you need it for a production environment please keep in mind that SPX is not yet production ready, not enough reviewed, tested...
To summarize:
- A PHP script is launched with SPX disabled.
- Something like a SIG_USER2 is sent to the process and interpreted as this configuration:
SPX_ENABLED=1 SPX_REPORT=full
which means it will produce a report for the web UI.- Are you ok with that?
- SPX will be disabled once the process is finished or if another user signal is sent.
- SPX should supports several on/off cycles for the same script.
About the implementation:
- Not so straightforward
- Will require a custom automated test infrastructure (BTW same issue for web UI) in case we want tests
- It is possible to start profiling without having kept track of the call stack (it can be unwound with Zend Engine like debug_backtrace do), just extra works
I prefer do it myself since it is a bit tricky and it will touch the most critical parts. It might be done withing a month or two at the latest.
If you have some ideas for the automated tests or event want to make them I'm interested.
from php-spx.
Yeah, I think that the biggest issues nowadays is the lack of support for the little stuff that makes those kind of components production friendly :)
I know that it's not production ready but it is for an internal tool that will be used once every month but that will have to process a lot of data (ie. billions) so having a profiler that can be turned on/off on demand would be great!
I already worked with those kind of systems both in C# and Java and I am quite good with C and I have a little of experience with pre php70 extensions so if you want I may try to help.
About the testing, it is a quite complex situation to test, probably the best would be to mock the code related to the signal handler so it could be tested easily, I will start taking a look on how you implemented the tests, I didn't ever used C testing frameworks.
EDIT
About the file format, do it supports the Google Trace View? If it supports ftrace it could be used
https://github.com/catapult-project/catapult/tree/master/tracing
from php-spx.
If you feel you can do it I can assign to you, it suits me.
Feel free to ask me some hints if you have doubts or if things get complicated.
About Google Trace View, can you open another issue ?
from php-spx.
Thanks!
from php-spx.
It might be worth noting that php-fpm already has special behaviour for USR2, so this might conflict/confuse things in that scenario.
from php-spx.
@orls good point.
The signal handlers are (or should be) registered only for CLI SAPI.
EDIT: this is currently the case
Line 444 in ce5f554
from php-spx.
Related Issues (20)
- Join Github sponsor HOT 1
- Feature request: downloadable reports HOT 1
- Do not enable SPX when JIT is enabled HOT 3
- Core dumped when executing with long arguments HOT 5
- Link to code.jquery.com HOT 2
- UI / Report: highlight a partircular (or pattern) function call count as a dynamic metric
- Feature request: visualize static and instance methods differently
- Feature Request: SQL Query time HOT 1
- Accessibility issue. Light mode needed as not everyone can see the dark contrast. HOT 2
- PHP 5.4 support HOT 1
- Web UI not loading HOT 1
- Support for PHP 8.3
- Potential misinformation about leak HOT 3
- No UI on site hosted behind Reverse Proxy HOT 3
- ESM modules resolution error HOT 1
- File not found. HOT 1
- Install fails in MacOS Ventura HOT 4
- SPX does not intercept when using built-in server HOT 1
- configure error on macOS : cannot find zlib HOT 3
- spx.so: undefined symbol: gc_globals HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-spx.