Page Stats<

liunx

Guest
How do I show the percentage of the page that is PHP and SQL queries...

eg...

60% PHP / 40$ SQL Queries

Thanks in advance.Could you be a little more specific? What are you trying to accomplish with this anyway?Seems clear to me :rolleyes:

How do I display how much of the page is made from PHP and MySQL queries?

Like at the bottom of the page here...

<!-- m --><a class="postlink" href="http://www.xmbforum.com/community/boards/viewthread.php?tid=748876Well">http://www.xmbforum.com/community/board ... 748876Well</a><!-- m -->, I took a look at that. They just have the value, it isn't dynamically put there. it has been inserted manually for all teh pages. here is the source code


<!--Begin Template: footer_phpsql -->

[PHP: <b>84.2%</b> - SQL: <b>15.8%</b>]


<!-- End Template: footer_phpsql --><br />


So, as you can see, the values are just entered there. i don;t think its possible to dynamically get it.Gamini, you can't look at the source and say it is manually put there. it is php and it is dynamically coded.

I know how to get the queries but I do not know how to make it see how much php there is.

maybe it is taking those queries and doing some math on them to see how much it is out of a 100% and then saying it is all php.oh yea, sorry, I know waht you mean now. well, i have never heard of such a thing. Well, it must be possible if that site has already done it. well, i don;t know if this may help but you could take a prowl round <!-- m --><a class="postlink" href="http://hotscripts.com">http://hotscripts.com</a><!-- m --> they may have it.Originally posted by scoutt
I know how to get the queries but I do not know how to make it see how much php there is.


I can figure out the math (maybe), how do you get the queries then?each time you run mysql_query you need to add 1 to a variable, it woul dhave to be global so you can use it anywhere in teh script.Ah cool, then take this off the total page loading time devide by 100?to get the total 'time' for all the queries wouldn't you run a time difference microtime script,add to a variable,then subtract from total and divide by 100?
 
Back
Top