Php matusri xhprof custompanel

2,142 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,142
On SlideShare
0
From Embeds
0
Number of Embeds
137
Actions
Shares
0
Downloads
6
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Php matusri xhprof custompanel

  1. 1. XHProf custom panel (CakePHP DebugKit) Masaki YOSHIDA
  2. 2. me ● Name: Masaki YOSHIDA ● Age: 27 ● Twitter: @ReSTARTR ● Blog: http://blog.restartr.com
  3. 3. Frameworks ● Usually use: ● Original Framework ● based on ZendFramework
  4. 4. XHProf ● Profiler ● a function-level hierarchical profiler for PHP ● has a simple HTML based navigational interface. ● Create Callgraph ● ● How to install ● pecl install
  5. 5. CakePHP1.3 callgraph
  6. 6. Symfony2 callgraph
  7. 7. Lithium callgraph
  8. 8. DebugKit ● CakePHP plugin ● Debug toolbar ● history,request,session,timer,sql logs, log, variables... ● custom panel
  9. 9. Custom panel
  10. 10. implement
  11. 11. • cakephp/ • app/ • controllers/ • helloworld_controller.php • plugins/ • debug_kit/ • xhprof/ • controllers/ • components/ • toolbar.php • xhprof.php • views/ • plugins/ • debug_kit/ • elements/ • xhprof_panel.ctp
  12. 12. Usage - controller var $components = array( 'DebugKit.Toolbar' => array('panels' => array('xhprof')), 'Xhprof.Xhprof' => array('configs' => array( 'XHPROF_ROOT' => '/var/vhosts/xhprof', 'XHPROF_SOURCE_NAME' => "helloworld" )), );
  13. 13. Usage – action method function index() { $this->Xhprof->start(); $this->set('msg','hello world!.'); $this->Xhprof->end(); }
  14. 14. todo ● Refactoring ● call graph panel
  15. 15. Thank you.

×