The last days I was trying to install and run the xhprof.
I finally made it and I think that it brings up very interesting information. I also installed graphviz and I can generate nice graphs, but I would like to find a documentation explaining what the colors in the graphs mean? What does exactly mean each column of the profiler report and how is it calculated.
I was trying to find something the whole day, but unfortunately the only information that I found were usage documentation.
Does any of you have such documentation or know a link?
This link seems to be broken...
The documentation is still available via archive.org.
I've filed an issue with facebook about it already.
have you tried this site:
http://techportal.inviqa.com/2009/12/01/profiling-with-xhprof/
it contains all required basic information needed for digging deeper into XHProf.
you will also find windows builds here: www.phpfluesterer.de
Related
Problem
I have a legacy codebase I need to analyze and determine dependencies. Particularly the dependencies on classes (internal/external) and extensions (Memcache, PDO, etc).
What I've Tried
I have reviewed the tools listed in Is there a static code analyzer for PHP files?. Unfortunately, this post is dated and most of the promising tools like phpCallGraph no longer work.
My thought was to analyze the code lexically and look for class tokens. Reviewing a list of these would at least allow me to visually determine dependencies. However finding OtherClass in the following code may be complex:
$classname = 'OtherClass';
echo $classname::doubleColon();
In the end, I doubt I'm the first to need this. I'm sure a tool or combination of tools exist to provide what I need. So I'm asking the SO community before writing this myself.
Update
Ideally this tool will analyze multiple files with complete code coverage. As such, tools like Xdebug, while great, are not solutions to this exact problem.
Instead of phpCallGraph you could use Gopal Vijayaraghavan's inclued extension which in combination with Graphviz gives you a nice looking graph of all included files for a certain execution path.
Example:
Moreover, I'd recommend Xdebug (a PHP debugger) which offers a profiler that outputs data consumable by Valgrind. Use the debugger with a compatible IDE to follow the execution path (which helped me a lot to wade thru e.g. Drupal's massive call-stack).
Combine both and you should get a fairly thourough overview.
EDIT
Searched the web and found nWire for PHP - an eclipse plugin that looks like it could be the right tool for you (30 day free trial which should be enough to give you a head start).
I think PhpCodeAnalyzer is exactly what you're looking for - https://github.com/wapmorgan/PhpCodeAnalyzer
It print list of all used external extensions in code base.
What do you use for automatic PHP docs generation.
I know about phpdocumentor. but it looks like it didn't have a single release within 2010.
Should I just use it or are there any alternatives?
You can try using DocBlox, a Documentation Generation application inspired on phpDocumentor.
Please see http://www.docblox-project.org for the website and/or http://demo.docblox-project.org/default for a demo.
We use Doxygen at work, but I must confess that I haven't used them much since setting it up in our continuous integration server. NetBeans and other IDEs parse and display the docs when you hover over and auto-complete items.
PHPdocumentor 2 is currently in alpha phase but still usable, so it seams that the project development ist continued.
I use firebug and smarty so i get good debugging data from that but i'd like to see my database query times and page processing times as well.
Xdebug is very good. It works very well in combination with Netbeans IDE for PHP.
This is a great package to relay data to firebug:
http://www.firephp.org
xdebug is awesome, because it lets you step through code inspecting variables as you go.
It also lets you do profiling (dumps callgrind files into a directory of your choosing, describing in very detailed fashion what happened how many times, when, and how long everything took)
To take full advantage of xdebug, you need a good IDE, i suggest netbeans, but you can use any one of the major packages nowadays.
As linked many times by others, FirePHP and Xdebug are awesome...
But you also asked about page render times and query times.
Unless you're already using a framework that collects this data for you, you're going to need to collect it and set up reporting for it yourself.
Debugging PHP Code on Windows with Visual Studio 2008 or 2010 => http://www.jcxsoftware.com
HI
Does anyone know where I can find good documentation on the Pear module Net_DNS?
There is its End-User Documentation, on PEAR's website.
There are a couple of examples for some methods, like Net_DNS_Resolver::query().
(Yeah, one problem with PEAR package is that some of them are not that well documented... This doesn't seem to bad, on this point ; I've seen worse ^^ )
there is also the generated API docs for Net_DNS; available at http://pear.php.net/package/Net_DNS/docs/latest/
If you have the time, and feel like you would like to help the PEAR project, you could always submit an update or "Documentation Problem" bug report.
Has anyone got these to work together seemlessly? I have tried, had some success using the plugin at http://phing.info/trac/wiki/Users/Documentation/CruiseControl, but have failed to:
Get the metrics graphs working (nothing appears)
Enable the "PMD" - project mess detection - reports
Are there any other ant-specific commands that must (can) be run in addition to my phing build script?
Also, the front page of the reports section dumps a heap of log information, and I'm trying to get rid of that too.
Cheers for any help ... we are running phing 2.3.0 and phpUnderControl 0.4.7.
Paul
Our application framework makes heavy use of Phing, and we've got that integrated under CI with phpUnderControl. We do have the metrics and PMD working now, and honestly, it was a little bit of an accident that it started working. But we're still missing the code coverage (working on it) and the phpDoc output (working on that too). I'll try to remember to come back and update this when we're done.
I have found that the main reason for the metrics not showing up is an incompatibility with the ez library that phpuc uses for the rendering. You'll get this NullPointerException on the page, right? Then when you try to run a build manually, you'll get this obscure error about index and divide by 0? What's happening is the ez graphics library that ships with phpuc is old, and you have to upgrade it. I hope that's a clue for you. We didn't have trouble with PMD stuff, so I don't know why that wouldn't work for you. If you want to update your question with more specifics, maybe I can elaborate on what's worked for us?
To answer my question, in the end I figured it was easier to just use an ant build script to make everything work.
I think phing is good when starting out, and has an excellent dbdeploy feature (which I use in phpUC), but for getting the metrics and the PHPMD integrated you are better off using ant - the XML is not hard.
Cheers