PHP Classes
elePHPant
Icontem

PHP Script Profiler: Profile the execution of PHP scripts

Recommend this page to a friend!
  Info   View files Example   View files View files (5)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2014-10-30 (5 years ago) RSS 2.0 feedNot enough user ratingsTotal: 135 All time: 8,924 This week: 400Up
Version License PHP version Categories
script_profiler 1.0.0Custom (specified...5.4PHP 5, Time and Date, Performance and...
Description Author

This class can profile the execution of PHP scripts.

It can start measuring the time a section of a script takes to execute from one point to another point of the script.

Each profiled section may have a named label. Multiple sections can be profiled in the same script.

A summary of the profiled script sections can be displayed outputted to a given log file. It includes the time spent and the memory being used.

  Performance   Level  
Name: Mike Jordan <contact>
Classes: 5 packages by
Country: United States United States
Age: 56
All time rank: 1516207 in United States United States
Week rank: 329 Up27 in United States United States Up
Innovation award
Innovation award
Nominee: 1x

 

Details
App:       PHP Script Profiler
Version:   1.0.0
Author:    MT Jordan <mtjo62@gmail.com>
Copyright: 2014
License:   zlib/libpng License

**********************************************************************************

PHP Script Profiler is a script profiler that is designed to help determine
execution time or memory bottlenecks in PHP scripts.

*********************************************************************************

PHP Script Profiler Features:

    * Diagnose execution time errors or memory errors for intensive SQL queries
    * List unnecessary or unknown included/required files
    * Create unlimited profile points
    * Print to screen or save to local file

Requirements:

    * PHP 5.4+

*********************************************************************************

Usage:

<?php

include 'profiler.php';

$profile = new profiler;

//Create profile point
$point_1 = $profile->start_profile( 'Profile Description 1' );

//Code to profile - ie: SQL Query, display data, etc.

//End profile point
$profile->stop_profile( $point_1 );

//Create profile point
$point_2 = $profile->start_profile( 'Profile Description 2' );

//Code to profile - ie: SQL Query, display data, etc.

//End profile point
$profile->stop_profile( $point_2 );

//Print to screen
echo "<pre>{$profile->print_profile()}</pre>";

//Write to file
$profile->print_profile( 'logs/profile_log.txt' );

?>
  Files folder image Files  
File Role Description
Accessible without login Plain text file example.php Example Example script
Accessible without login Plain text file license.txt Lic. License File
Plain text file profiler.php Class PHP Script Profiler is a script profiler
Accessible without login Plain text file profile_log.txt Output Example log file
Accessible without login Plain text file readme.txt Doc. Readme file

 Version Control Unique User Downloads Download Rankings  
 0%
Total:135
This week:0
All time:8,924
This week:400Up