Coder Social home page Coder Social logo

Comments (7)

danielealbano avatar danielealbano commented on July 19, 2024 1

I will start to look into the code more in the detail this weekend 👍

from php-spx.

NoiseByNorthwest avatar NoiseByNorthwest commented on July 19, 2024

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:

  1. A PHP script is launched with SPX disabled.
  2. 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?
  3. SPX will be disabled once the process is finished or if another user signal is sent.
  4. 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.

danielealbano avatar danielealbano commented on July 19, 2024

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.

NoiseByNorthwest avatar NoiseByNorthwest commented on July 19, 2024

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.

NoiseByNorthwest avatar NoiseByNorthwest commented on July 19, 2024

Thanks!

from php-spx.

orls avatar orls commented on July 19, 2024

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.

NoiseByNorthwest avatar NoiseByNorthwest commented on July 19, 2024

@orls good point.
The signal handlers are (or should be) registered only for CLI SAPI.

EDIT: this is currently the case

if (context.cli_sapi) {

from php-spx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.