jonaswouters / xhprofbundle Goto Github PK
View Code? Open in Web Editor NEWXHProf bundle for Symfony 2
XHProf bundle for Symfony 2
$ app/console config:debug jns_xhprof
[LogicException]
Configuration class "Jns\Bundle\XhprofBundle\DependencyInjection\Configuration" should
implement ConfigurationInterface in order to be dumpable
Hi, since this bundle use an Entity definition and not MappedSuperclass, launching schema-update
command will insert the details
table in mysql.
But there is a big mistake on this table, xhprof called a column get
which is a reserved words on mysql 5.6.
I'm not sure if there is solution planified at this moment from xhprof team but we could transform the entity as mapped superclass to avoid automatic creation of this one even if we don't care about.
User'll have to create an Entity which extends the superclass to benefits of details
table (if he's on mysql < 5.6).
I can make a PR if you're ok.
@Gissues:{"order":50,"status":"notstarted"}
Hi,
I'm using symfony-standard v2.1.11, and it requires doctrine/doctrine-bundle v1.1.0.
But XhprofBundle requires doctrine/doctrine-bundle v1.2.0.
Now, when executing composer update
, there will be an error with message Your requirements could not be resolved to an installable set of packages
.
Why i must load facebook/xhprof package with this bundle?]
Thank.
XhprofCollector::collect
is called at the end of the first subrequest which runs stopProfiling
Hi,
I created jns/xhprof-bundle
some time ago (coz i needed that on my project). But it was a mistake, because actually i can't activate auto-update via github service hook.
Please, @jonaswouters can you register on https://packagist.org and gimme your username ? I'll add you as maintaner of https://packagist.org/packages/jns/xhprof-bundle, btw, you'll be able to activate the service hook to automatically update package.
Sorry for this mistake.
HI all I have a problem in setting up the bundle with XHGUI.
this is the DEV environment
the bundles save the profiled data correctly to MYSQL but when I try to access XHGUI from the profile console I get an error from the http://xhprof:81/xhprof_html/.
The server created for xhpro.
The error is 500 internal server error.
This is the error in apache LOG :
[Mon Mar 03 18:16:38 2014] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Mon Mar 03 18:16:38 2014] [debug] core.c(3112): [client 127.0.0.1] r->uri = /Users/me/webtool/dev.php
It looks like the problem is in .htaccess config of the symfony2 public directory, or in the apache virtualhost for xhprof. Any one has an idea ? Have you ever had such a problem with symfony2 and this bundle ?
thanks a lot!
hi. can you add license pls? (it's not on packagist too...)
Hello,
I did not notice when, but such bug appeared.
Our configuration:
jns_xhprof:
enabled: true
command: option
command_option_name: xhprof
Upon clearing caches this always happens no matter if we set the option or don't:
The "--xhprof" option does not exist.
...
Jns\Bundle\XhprofBundle\EventListener\CommandListener->isProfileOption() at /var/www_match/vendor/jns/xhprof-bundle/EventListener/CommandListener.php:125
...
Maybe it was impacted by Symfony 2.8 upgrade?
I managed to workaround this by using new Symfony 2.8 functionality and simplifying isProfileOption
method:
private function isProfileOption(ConsoleCommandEvent $event)
{
$definition = $event->getCommand()->getDefinition();
$input = $event->getInput();
$definition->addOption(new InputOption($this->optionName, null, InputOption::VALUE_NONE, '<info>JnsXhprofBundle</info>: Whether to profile this command with xhprof', null));
$input->bind($definition);
}
Hi,
I try to use you bundle, however I 've a problem when I implement a the bundle with a new database. My configuration looks like this
-- my jns_xhprof.yml
jns_xhprof:
location_web: http://profiler.api.me.lan/
entity_manager: profiler
enabled: true
entity_class: Acme\ProfilerBundle\Entity\XhprofDetail
enable_xhgui: true
command: option
command_option_name: xhprof
In my config.yml,
doctrine:
dbal:
default_connection: default
connections:
default:
driver: "pdo_pgsql"
host: "localhost"
port: "5432"
dbname: "app"
user: "user"
password: "user"
charset: UTF8
profiler:
driver: "pdo_pgsql"
host: "localhost"
port: "5432"
dbname: "profiler"
user: "profiler"
password: "profiler"
charset: UTF8
orm:
default_entity_manager: default
auto_generate_proxy_classes: "%kernel.debug%"
entity_managers:
default:
connection: default
mappings:
AcmeAppBundle: ~
profiler:
connection: profiler
mappings:
AcmeProfilerBundle: ~
then I create my entity class like said in readMe
use Jns\Bundle\XhprofBundle\Entity\XhprofDetail as Base;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="details")
*/
class XhprofDetail extends Base
{
/**
* @var integer $id
*
* @ORM\Column(name="id", type="string", unique=true, length=17, nullable=false)
* @ORM\Id
*/
protected $id;
}
And when I deploy with the symfony command, my 'details' table contains only Id.
php app/console doctrine:schema:update --em=profiler
-- results
Table "public.details"
Column | Type | Modifiers
--------+-----------------------+-----------
id | character varying(17) | not null
Why My entity doesn't inherit of the MasterMappedClass ? That very strange because when I unset the em=provider in my command, the table was generated correctly. Do I do a bad something ?
Cheers
I need to run a command few times before XHProf start run
text shows up, otherwise xhprof won't debug my code... It's annoying because it's so random this triggers or not...
Trying to run a "composer update"; I get the following error:
Problem 1
- jns/xhprof-bundle dev-master requires facebook/xhprof * -> no matching package found.
- jns/xhprof-bundle dev-master requires facebook/xhprof * -> no matching package found.
- Installation request for jns/xhprof-bundle dev-master -> satisfiable by jns/xhprof-bundle[dev-master].
Dont know if you're aware of this: https://github.com/orbisnull/XHProfiler (very young project, first commit 14 days ago)
Maybe this could be used internally instead of relying on PHP scripts installed with xhprof extension (xhprof_lib.php, xhprof_runs.php; both encapsulated in this GitHub repo).
Works with composer.
@Gissues:{"order":75,"status":"notstarted"}
This is kinda strange. It was working fine, but today after I run composer self-update
and then composer install
I've got this issue:
*@cat:~/projects/*/www$ ./composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
- Installing facebook/xhprof (dev-master 6bf0072)
Cloning 6bf00728827fc1e2a639dff6f94f1618396bffc5
- Installing jns/xhprof-bundle (dev-master 2630d49)
Cloning 2630d49bab9b0722c8e184e2e8153edbdbe74d5f
- Installing sensio/generator-bundle (dev-master e50108c)
Cloning e50108c2133ee5c9c484555faed50c17a61221d3
jns/xhprof-bundle suggests installing ext-xhprof (Hierarchical Profiler for PHP)
Generating autoload files
Updating the "app/config/parameters.yml" file
[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]
Xhprof Bundle is enabled but the xhprof extension is not enabled.
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command.
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [--ignore-platform-reqs] [packages1] ... [packagesN]
Users which don't want to use mysql “logging“ of details should not have this table installed.
Hello,
First of all, thank you very much for that great bundle! :)
It works perfectly in dev mode from the debugging bar, and I also got the URL in headers when in prod mode.
When I run it in console, with the "option" or the "on" config values, I get a link, but always with a wrong id :(
In my app/config.yml file:
jns_xhprof:
location_web: http://localhost/xhprof
enabled: true
command: "option"
command_option_name: "profile"
An example command and result:
php app/console doctrine:schema:validate --env=dev --profile
XHProf starting run
---
[Mapping] OK - The mapping files are correct.
[Database] OK - The database schema is in sync with the mapping files.
---
XHProf run link http://localhost/xhprof?run=5322d47c49104&source=Symfony
And when I follow the link:
Run Report
Run #5322d47c49104: Invalid Run Id = 5322d47c49104
Did I miss something?
hi,
i needed console profiling. for now, i just slapped together a console event listener (symfony 2.3+) but if you are interested, i can do a pull request.
the code at https://github.com/dbu/XhprofBundle/blob/master/DataCollector/XhprofCollector.php#L52 is checking something about cli - is that working already?
if you want, we need to agree how to refactor the code as on console there is no request. XhprofCollector could provide entry points for the console. we could have separate configuration for the console too, or use the same (for the exclude patterns at least, a separate config makes more sense)
Hi Jonas!
Is there any support for session-wide logging through a request parameter? It would be particularly interesting to enable logging for Ajax and Post requests.
If the bundle doesn't support it already, is that something you'd accept as a pull request?
Thanks for the bundle, it's awesome, in any case ;)
testing
Hi,
Is there any documentation about how to actually use this bundle - I can see how to install and configure it. But how to inject the service(s), how to start the profiling, and how to collect the results for the web page. Does this bundle set up a route for the web page from web_location, or do you have to do that yourself. I'm also using it with XHGui, as that seems to be allowed.
many thanks
I have set this bundle up with a separate entity manager and everything seems to be working. When loading a page I can see in the MySQL log that a transaction is started, an insert query is issued and the transaction is committed. But nothing is being saved.
There's a lot of binary data being inserted, which makes it really hard to copy and retry the query in order to see its potential error message. I am at loss at how to debug this. Any ideas please?
Hi!
How do I use XHGui with XhprofBundle?
I mean, do I have to set XHGui up as standalone thing and just add its hostname to app/config/config.yml to 'location_web'?
Hi,
I got an error:
Fatal error: Jns\Bundle\XhprofBundle\DataCollector\XhprofCollector::stopProfiling(): Failed opening required
There is a new parameter named location_config
need to be set.
I have no idea how to add the parameter.
Could someone figure this out?
Hi
I have been trying to make this bundle to work, everything works fine but it is forcing me to create a config.php (which is actually empty)
What contents should be there? And more than this... could config.php location be optional instead of mandatory?
Anyway, great work on integrating xhprof in symfony2 profiler!
I am using Symfony 2.0 and I want to use this bundle but i got some errors, is possibly to have a 2.0 branch, I can collaborate to this if you need.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.