The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Microstats (only for admin) - load times, server loads, queries, uncached templates! Details »» | |||||||||||||||||||||||||||
Microstats (only for admin) - load times, server loads, queries, uncached templates!
Developer Last Online: May 2013
Version 1.0 - works for most servers
Updated 1.1 - optimized code Updated 1.2 - added names of uncached templates! Okay, the original was by TECK. This is NOT based on his code - it is based on vB3's native code. If TECK wants me to remove this, I will do so. This is just my version that I use for my private forums. Information shown: 1) Page loading times 2) Number of Queries 3) Server Loads 4) Number of Any Uncached Templates 5) Name of Uncached Templates (NEW!) By default only an Admin (usergroup 6) can see it. Feel free to modify this bit. It's very easy to install. Open includes/functions.php: Find: PHP Code:
Version 1.2 - more optimized but requires /proc on your server - try this, if server loads don't show up use Version 1.02 below PHP Code:
Version 1.02 - Use this if Version 1.1 doesn't work for you. PHP Code:
Done! As simple as that. No need to enable debug mode. If you want only yourself to have this information, change: if ($bbuserinfo[usergroupid]==6) { to if ($bbuserinfo[userid]==1) { And replace 1 with your userid. To let everyone see it, remove that line, and the last } of the code above. Below is a screenshot of how my forumhome microstats look. EDIT: Thanks to kmike, I optimized the code. This should lessen the load when checking the server loads slightly. Version 1.2 and 1.02 now has added code to show NAMES OF UNCACHED TEMPLATES! Show Your Support
|
Comments |
#262
|
|||
|
|||
*clicks install*
|
#263
|
|||
|
|||
How can you choose where the stats show up on your forums?
|
#264
|
|||
|
|||
installed =D
|
#265
|
|||
|
|||
Sweet going to install it now
|
#266
|
||||
|
||||
Thanks Erwin.
|
#267
|
|||
|
|||
Code:
// Microstats hack
if ($bbuserinfo[usergroupid]==6) {
$pageendtime = microtime();
$starttime = explode(' ', $pagestarttime);
$endtime = explode(' ', $pageendtime);
$totaltime = vb_number_format($endtime[0] - $starttime[0] + $endtime[1] - $starttime[1], 5);
$loadavg = @file_get_contents("/proc/loadavg");
if ($loadavg) {
$regs = explode(" ",$loadavg);
$serverload=' [Server Loads: <b>'.$regs[0].'</b> '.$regs[1].' : '.$regs[2].']';
}
$debughtml = "<center><span class=\"smallfont\">Page generated in <b>$totaltime</b> seconds with <b>$query_count</b> queries" . iif($_TEMPLATEQUERIES, " (<b>" . sizeof($_TEMPLATEQUERIES) . "</b> queries for uncached templates)", '') . "$serverload</span></center>";
ksort($tempusagecache);
foreach ($tempusagecache AS $tempname => $times)
{
if ($_TEMPLATEQUERIES["$tempname"]) $debughtml .= "<center><span class=\"smallfont\">Uncached templates: <font color=\"red\"><b>$tempname</b></font> ($times)</span></center>";
}
$vartext = str_replace('</body>', "$debughtml\n</body>", $vartext);
}
//Microstats Hack
I'm not a coder by any means, but if I remove the above (in red) will that show to all users? Thanks. What I mean is, is the above code workable or will it do something horribly wrong? |
#268
|
|||
|
|||
Yes, if you remove that it will show to all users...
|
#269
|
|||
|
|||
Quote:
|
#270
|
|||
|
|||
Page generated in 0.08409 seconds with 9 queries
sweeeeet |
#271
|
|||
|
|||
does this exists for 3.5 version ?
we have it installed and want to upgrade from 3.0.x version of our forum to 3.5 thanks. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|