- Messages
- 2,293
- Reaction score
- 50
- Points
- 48
So I'm bored, and i decided to make a php profiler for people wno want to know why there site is slow or they keep getting suspended for resource usage.
Right now you need to manually add the line tags and such, but i plan to make another script that parses the php file and modify it to add the needed lines of code.
So first example:
http://srg.x10hosting.com/test/test.php.without
well what could possibly be wrong with that
well after i apply my lines(which will be automatically added by said un-started script parser)
http://srg.x10hosting.com/test/test.php.with
After thats run, we get 3 files:
http://srg.x10hosting.com/test/Warnings.txt
http://srg.x10hosting.com/test/CallStack.txt
http://srg.x10hosting.com/test/PHP_ProfileLog.txt
Quick note: CallStack and PHP_ProfileLog have been shortened since they were originally 16000 lines, and several MB in size
so with the warnings, we can see several problems, and in the future, the callstack file will also contain variables on that line, for the new value of whatever the value of it is(ie $t = pow($i,10);//$t = 10 )
This is the current values that generate warnings:
any tips, comments, suggestions on what i should do(i'm still not done, but i'm wondering what others think of it)
Right now you need to manually add the line tags and such, but i plan to make another script that parses the php file and modify it to add the needed lines of code.
So first example:
http://srg.x10hosting.com/test/test.php.without
well what could possibly be wrong with that
well after i apply my lines(which will be automatically added by said un-started script parser)
http://srg.x10hosting.com/test/test.php.with
After thats run, we get 3 files:
http://srg.x10hosting.com/test/Warnings.txt
http://srg.x10hosting.com/test/CallStack.txt
http://srg.x10hosting.com/test/PHP_ProfileLog.txt
Quick note: CallStack and PHP_ProfileLog have been shortened since they were originally 16000 lines, and several MB in size
so with the warnings, we can see several problems, and in the future, the callstack file will also contain variables on that line, for the new value of whatever the value of it is(ie $t = pow($i,10);//$t = 10 )
This is the current values that generate warnings:
PHP:
//These define when to give warnings
// 10 kb
define("LOOP_MEMUSE", 10 * 1024, true);
// 1 second
define("LOOP_TIME", 1, true);
// 5000 Iterations
define("LOOP_IterateCount", 5000, true);
// 1 kb
define("JUMP_MEMUSE", 1 * 1024, true);
// .1 milisecond
define("JUMP_TIME", 0.0001, true);