Drupal Profiler Module - SoC 2008 Application

Overview

Drupal currently has a number of extremely effective developer-assist modules, most notably Devel and SimpleTest, each of which facilitate the creation and development of modules. In Drupal 7, one of the key objectives is the inclusion of a unit-testing API further enhancing the developer toolset. A profiling module would serve to allow Drupal developers a way to monitor the over all performance of code and test refinements against a benchmark while expanding the available developer toolset. In addition, a profiling module could serve to provide a set of trigger conditions to refine the throttle module in disabling elements as the system approaches capacity.

Initial development of a profiler module as a Summer of Code project would center around the creation of an extensible API similar to that of the SimpleTest module and a set of inital monitoring hooks to watch the performance of core functions and modules at a high abstraction level. The intent would be for developers to include profiler hooks within their modules at specific points of interest to add clarification to the module provided overall metric. Data collected via the API and initial hooks would be maintained and graphed so that developers can establish a performance standard across time frames and system loads. Data would be displayed in a charting series via the administration screen and as a button element on displayed pages, displaying a javascript window indicating the performance of particular page elements similar to Devel in presentation style.

There are existing profiler modules, such as loadtest. However they don't serve to cover the entire scope of functionality as described in this proposal and don't include facilities for triggerable load levels in disabling modules and blocks based upon the developed metrics.

Implementation

Most current PHP profilers require an extension be loaded or compile into the PHP core application. The Drupal profiler module shouldn't require access to any extension to provide accurate metrics, but should include the ability to incorporate them via developer created metrics extensions in the future. PHP only metrics are possible, but require function hooks to be placed in code appropriate locations.

The primary method for monitoring performance of specific code blocks would be done via calls to a start/stop profiler method. Information passed from the calling function into profiler along with stack information collected from PHP4/5 function debug_backtrace and the built in Drupal timer functions would serve as the basic information along with a database backed log for the calling function.

It would be ideal to provide timing functionality without any modifications to core, at the very least the API and monitoring back end should be provided without requiring a code patch. But if the best implementation would include some kind of optional core patch, it should be allowed to be kept 'on-the-table' in terms of implementation. Modification to core may be required to facilitate accurate automatic high-level timing of modules and functions. This will require experimentation during the development process and is included in the sample development timeline. Code modifications could also be considered because of the intention for the profiler module to be deployed on a development server rather than directly in a production environment. Ultimately, the decision to provide a core patch for monitoring would come down to the accuracy of automated monitoring via a module only implementation.

Development Timeline

Pre-start

Time during the bonding period will be used to explore the options for including automated high-level monitoring without the use of core modifications, in addition to research into using the google charts API for the graphical presentation in combination with using JQuery for the presentation overlays. That is in addition to the actual mentor-student bonding.

May 26 - June 9 (Basic Development)

- Initial Module Development
- Basic API Implementation, developer added timing hooks, back end logging, text-only result display
- Initial Module Testing

June 9 - June 23 (High Level Monitoring)

- Addition of automated module timing (possibly via core patches if required)

June 23 - July 7 (Display Refinement)

- Implementation of graph timing displays in administration pages and per element (devel style)

July 7 - 21 (Essential Features)

- Integration with the Throttle module
- Development of external metrics API (for use with Zend Profiler, etc)

July 21 - August 4 ( Additional Features )

- Tailored Monitoring (monitor per user roll, per ip, per login, page percentage)
- Integration with the Devel module (addition of SQL timings into metrics, display integration)

August 4 - 11 (Finalize - Documentation)

- Final Testing
- Additional documentation of the developer and external monitoring plugin.

Final Deliverable

A complete profiler module which implements the above outlined functionality in addition to documentation describing the developer API and external metrics API.

This may include an optional core patch depending on the effectiveness of external metrics for high level monitoring

Future Development

After the conclusion of SoC, it is my intention to remain as a maintainer of the profiler module, refining the existing features and implementing additional elements as they are suggested by the community at large.

About Me

After leaving school, I've worked in PHP development for the last 3 years professionally as a web developer for Standardbred Canada, a medium sized non-profit based in Mississauga, Ontario, Canada. I served as the lead developer for TrackIT, a pay per use member service based web application (http://trackit.standardbredcanada.ca). I've worked with drupal since May 2007, when Standardbred Canada decided to redesign their home site and I championed the use of Drupal. We're now planning to release our redeveloped site based on Drupal 5 and including several custom modules accessing our external database at the end of April. In the past, I've attended DrupalCamp Toronto in May 2007, and attended DrupalCon Boston with a couple other developers from work this past March. I'm hoping to present this May at DrupalCamp Toronto showcasing how we've tuned our redesigned website for dial up users.

I'm currently attending Seneca College in Toronto, Ontario, on a Part Time basis, and will be graduating in September of 2008. It's my intention to continue on and obtain a BA in Computer Science by 2010 at York University.

I enjoy working with Drupal and am looking forward to this opportunity to make an important contribution to the Drupal community.

Contact

Please feel free to contact me via email at scott@driftlogic.net or on msn at ethic_def@hotmail.com should you have any questions, comments, or suggestions regarding this application.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options