PHP Profiler

masshuu

Head of the Geese
Community Support
Enemy of the State
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:
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);
any tips, comments, suggestions on what i should do(i'm still not done, but i'm wondering what others think of it)
 

buyphiten

New Member
Messages
56
Reaction score
0
Points
0
im not sure about yr script... but does having a better script really helps a lot in saving resource usage?
because so far i did not get warning at my current host and x10.

but previously when i was with vodahost, i got suspended for 3 times. i remodify the script but it still trigger the r.usage. so im thinking if the host allows up to 25%, its difficult to trigger it right? to my knowledge, voda only allow 5%.
 
Top