Remote profiling |
Site Admin
|
it's easy. Using cURL api supply DBGSESSID variable with your request to b.php. This variable can be sent in form of GET value, POSTed value, or COOKIE. An appropriate syntax for this variable is below:
DBGSESSID=1@myclientIPaddress:7869;d=0,p=1 where d=0 means don't debug code, p=1 means profile code myclientIPaddress means your client IP address - the address of the machine where you run PhpED. If there is a router between your client machine and the host servicing b.php (f.e. their networks are different), you have to either a) specify IP address of this router and turn NAT forwarding on it to forward incoming connections on 7869 port to your real client machine or b) specify "localhost" and use SSH tunnel. |
||||||||||||
_________________ The PHP IDE team |
|
Hi Dmitri!
Great! Let me test this once over the weekend and I will come back here if I still have issues with that. Thanks, Take care, Fred |
||||||||||||
|
|
Hi!
Now that another issue has been fixed by your team related to my settings, I can now confirm that this solution works flawlessly via a SSH channel. However, maybe another question related to that: Is there a way, using the profiler, to see the execution flow? I can see that something got hit 3 times, but I sometimes have a hard time figuring out what code executed the procedure where the line got hit. Thanks! Take care, Fred |
||||||||||||
|
|
@dmitri
Can debugbreak() (or dbg) be used to dump profile data to disk, similar to xdebug? Thanks, Temuri |
||||||||||||
|
Site Admin
|
Neither profiler nor debugger store anything on the server side, so php.ini can't help.
But you can access profiler's API, fetch collected data and store it anywhere you want to. |
||||||||||||
_________________ The PHP IDE team |
Site Admin
|
for example here:
http://forum.nusphere.com/php-code-coverage-t3802.html although the topic is entitled code coverage, it works with nothing else but profiler API |
||||||||||||
_________________ The PHP IDE team |
|
@dmitri
Got a few questions for you: 1. What does dbg_startprofiler() do and what are the call arguments 2. Is it possible to use the combination of dbg_startprofiler() / dbg_stopprofiler() around a piece of code I want to profile and then use dbg_get_profiler_results($results) to retrieve profiling data 3. I wrote a simple PHP socket listener hoping to capture the raw profiling output sent by debugbreak('1@myHost:7777;d=0,p=1,c=0') but I got the following error: DBG 5.0.8 Failed to start DBG session Reason: debugger internal protocol error I'm trying to use dbg in the same way as XDebug profiler. I want to be able to dump raw profiling data to a file on disk, WITHOUT having to run dbg listener. I am hoping that if I manage to get that done, I'd be able to write a tool similar to wincachegrind, thus improving PHPEd's profiling ability. I also want to eliminate the network transfer between the web server and my Windows-base development workstation where PHPEd listener is running. Please provide some research direction for me or share the details of dbg's undocumented features. Thanks, Temuri |
||||||||||||
|
Site Admin
|
Indeed the functions are for profiling part(s) of code.
As of protocol, you'll waste a lot of time trying to reengineer it (which is not so legal btw). And what is it for? You will try to re-implement all logic behind dbglistener and PhpED? In what direction data exported from PhpED will differ from data that would be stored by your potential interceptor that you're trying to develop? |
||||||||||||
_________________ The PHP IDE team |
|
@dmitri
No, I am not going to do that. It was an attempt out of desperation. All I want is to be able to profile my code without running dbg listener (just the way XDebug does). So, I'm looking for your help. Can you answer the following question? Is it possible to use the combination of dbg_startprofiler() / dbg_stopprofiler() around a piece of code I want to profile and then use dbg_get_profiler_results($results) to retrieve profiling data. That's all. |
||||||||||||
|
Site Admin
|
I don't see any advantages of storing data in a file on the server. You'll have to get it back to the client, then analyze and what you'll have in the result is exactly what you already have in the IDE. Why bother? If you think that the IDE gets more raw data and can show more than it shows, you're wrong.
As of those functions, they are just filters to temporary disable/enable gathering time. They do neither start nor stop the profiler. Profiler as well as debugger can't work without connection to the IDE. It's IDE sends commands and receives the results. |
||||||||||||
_________________ The PHP IDE team |
|
I'll explain my goal.
I was running apache benchmark (ab) tool with various requests/concurrency settings. I was using XDebug output to analyze the performance behaviour delta in several classes (class loader, ACL, Models, Navigation) under growing server load. Then I asked myself - can I do it with dbg, avoiding remote connection to the listener. Do you follow my logic? So, it would be very nice if dbg could dump profiling results to file on disk. I don't see that as an impossible task, because PHPEd itself does not measure anything. It should be just a matter of redirecting output. Thanks |
||||||||||||
|
Remote profiling |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by