XHGui on VM, Storage on Host

I’m doing some performance tuning on a project at the moment and my favourite tool is still XHGui – but it’s designed to run on the same machine as its victim and since this is a vagrant VM, the chances of me destroying the machine and therefore the data are pretty high! Instead, I set it up to store the data onto the host and I thought I’d share how I did that. Continue reading

Installing XHGui

There’s a new version of XHGui (well, a few months old) and it’s fabulous! It’s got a few new dependencies though so I thought I’d write down how I set up my version, in case it’s helpful to anyone else (and so I feel like a pro next time I have to do this!). If you’re not familiar with XHGui it’s a fabulously easy and friendly way to profile your application; to understand which method calls in a page take the time and how many times they are made, so you can improve the performance of your application. All these instructions are for my 32-bit Ubuntu 12.10 system, hopefully they will work for you or you’ll be able to adapt them as appropriate.

Dependencies

XHGui needs version numbers or fluffy animal names, because this is a really major release and quite different to what went before in both technology and in looks. In particular, it now uses MongoDB. If you’re not familiar with MongoDB, it’s a super-friendly NoSQL database that makes a really handy backend for this kind of unstructured data – because every run of every page will look different. Therefore you will need:

  • MongoDB itself
  • The pecl extension for mongo
  • The xhprof pecl extension (read on if you’re using PHP 5.4, there’s a gotcha)

Continue reading

Generating Callgraph with XHGUI

I had a frustrating bug the other day with a new XHGUI install, I am working on creating a VM for my new PHP tools course I am teaching in March and I wanted to pre-install and part-install a bunch of things so that I can show some great tools in a limited amount of time. My XHGUI wasn’t quite right though; it couldn’t generate the callgraph for me. Instead, it said:

failed to shell execute cmd=" "" -Tpng"

Continue reading