View Full Version : Microstats (only for admin) - load times, server loads, queries, uncached templates!
Erwin
01-04-2004, 10:00 PM
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:
// ################################################## ##################
// temporary code
global $_TEMPLATEQUERIES, $tempusagecache, $DEVDEBUG, $_SERVER, $debug;
UNDERNEATH, ADD:
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
// 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
Version 1.02 - Use this if Version 1.1 doesn't work for you.
// 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);
if ($stats=@exec('uptime')) {
preg_match('/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/',$stats,$regs);
$serverload=' [Server Loads: <b>'.$regs[1].'</b> ? '.$regs[2].' : '.$regs[3].']';
}
$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>";
$vartext = str_replace('</body>', "$debughtml\n</body>", $vartext);
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>";
}
}
//Microstats Hack
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! :)
DestinyIslands
01-05-2004, 01:30 AM
Interesting ... I might use this
- DestinyIslands
Alright sweet, this should help out in lookin at page loads and such
/me clicks install
MGM out
Koutaru
01-05-2004, 02:34 AM
Whoohoo. Will install :) Thanks Erwin!
Schorsch
01-05-2004, 11:02 AM
thanks Erwin.
Dean C
01-05-2004, 11:08 AM
Wow Erwin's on a modding spree :p Nice one :)!
xxskullxx
01-05-2004, 01:18 PM
Nice job erwin!
ThePartyBorg
01-05-2004, 07:25 PM
Oooo, installed it right away.
Tubbie
01-05-2004, 08:19 PM
Nice and easy!
THX
Serge
01-06-2004, 02:14 AM
If you are getting 2.55 is that bad for server load? I am on a shared server is that ok as it is shared or is that still bad?
EDIT: Actually server load seems to stay around the 2.0 range.
Gary King
01-06-2004, 02:27 AM
If you are getting 2.55 is that bad for server load? I am on a shared server is that ok as it is shared or is that still bad?
EDIT: Actually server load seems to stay around the 2.0 range.
How many simultaneous users do you have when you get those load times? They are fairly bad, but not THAT bad.
Serge
01-06-2004, 02:39 AM
There were 9 but I was the only registered user on the rest where bots I'm guessing although I didn't check.
Alien
01-06-2004, 02:46 AM
Nice job. :) Thanks!
Mijae
01-06-2004, 03:38 AM
Are 26 queries for forumhome too bad?
Erwin
01-06-2004, 03:52 AM
Are 26 queries for forumhome too bad?
Yes. Considering that on my heavily hacked forumhome I only use 8. :)
Mr. HillBilly
01-06-2004, 06:48 AM
Yes. Considering that on my heavily hacked forumhome I only use 8. :)
Yeah yeah know it all... some of us dont have all the php skills to reduce queries
Erwin
01-06-2004, 08:08 AM
Yeah yeah know it all... some of us dont have all the php skills to reduce queries
It's not about skills in reducing queries - it's about modifying the very optimized vB3 code as little as possible. :) Don't install hacks that are not really necessary.
Mijae
01-06-2004, 02:50 PM
How many queries does a normal non-modded forumhome page have?
I am going to upgrade to RC2 and then install the hacks again...
Serge
01-06-2004, 07:25 PM
The normal install at least for me has 8. Today I was look though and I have 8 people on my forums me and 8 guest 7 of which are bots and my server load shows up at 5.01 I am running on a shared server but still 5.01 still sounds a little high does it to you all? Should I report this to my host?
Gary King
01-07-2004, 12:50 PM
The normal install at least for me has 8. Today I was look though and I have 8 people on my forums me and 8 guest 7 of which are bots and my server load shows up at 5.01 I am running on a shared server but still 5.01 still sounds a little high does it to you all? Should I report this to my host?
Yeah sounds REALLY high.
Alien
01-07-2004, 02:31 PM
How exactly would I adjust this so ANYONE can view it, not just admins?
Serge
01-07-2004, 06:17 PM
How exactly would I adjust this so ANYONE can view it, not just admins? I don't know if I'm allowed to repost but this is what you would do.
// Microstats hack
$pageendtime = microtime();
$starttime = explode(' ', $pagestarttime);
$endtime = explode(' ', $pageendtime);
$totaltime = vb_number_format($endtime[0] - $starttime[0] + $endtime[1] - $starttime[1], 5);
if ($stats=@exec('uptime')) {
preg_match('/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/',$stats,$regs);
$serverload=' [Server Loads: <b>'.$regs[1].'</b> ? '.$regs[2].' : '.$regs[3].']';
}
$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>";
$vartext = str_replace('</body>', "$debughtml\n</body>", $vartext);
//Microstats Hack
Place that in the same EXACT place as you would have for the orginal hack all this did was took out the check for the admin part.
Serge
01-07-2004, 06:19 PM
Actually if you know what I'm talking about just take the frist if line out and then delete the } at the very end before the comment. That will do it I will work on that post although I have no clue why that happened might be a bug.
EDIT: I fixed the post above when I copied Erwin's code it came though with the color on it as well in the WYSISWG and it left it on there as well and then when I changed everything to black it didn't work but in the end I got it fixed.
Could you add gzip stats to it? please!
I don't know if I'm allowed to repost but this is what you would do.
// Microstats hack
$pageendtime = microtime();
$starttime = explode(' ', $pagestarttime);
$endtime = explode(' ', $pageendtime);
$totaltime = vb_number_format($endtime[0] - $starttime[0] + $endtime[1] - $starttime[1], 5);
if ($stats=@exec('uptime')) {
preg_match('/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/',$stats,$regs);
$serverload=' [Server Loads: <b>'.$regs[1].'</b> ? '.$regs[2].' : '.$regs[3].']';
}
$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>";
$vartext = str_replace('</body>', "$debughtml\n</body>", $vartext);
//Microstats Hack
Place that in the same EXACT place as you would have for the orginal hack all this did was took out the check for the admin part.
If you show the server load for everyone, you will kill your server.
Is for a reason I released originally this hack part for admins only...
Hope, this helps.
PS. Yes Erwin, you have my permission to publish any modifications for MicroStats and port it to VB3 software.
Thank you for asking.
Dark_Wizard
01-08-2004, 04:06 PM
Nice hack Erwin! Great to have while developing my vbWar 3.0. Thanks!
Alien
01-09-2004, 04:15 AM
Ahh, so this and even the one for vB2x were server killers, TECK? :)
I honestly never saw a difference in the server hmm.
I guess I can just set it up for admins to view if so...
Serge: Thanks for that help tho, much appreciated.
coKe67
01-10-2004, 10:52 AM
Thanks Erwin,
nice & easy:squareeyed:
Vigile
01-11-2004, 11:06 AM
Page generated in 0.25738 seconds with 12 queries (3 queries for uncached templates)
Ok.. call me a knob if ya want, but what is the '3 queries for uncached templates' part trying to tell me? I'm presuming its something I need to fix.
Erwin
01-11-2004, 11:20 AM
Page generated in 0.25738 seconds with 12 queries (3 queries for uncached templates)
Ok.. call me a knob if ya want, but what is the '3 queries for uncached templates' part trying to tell me? I'm presuming its something I need to fix.
You have 3 uncached templates, which is causing that page to have 3 extra unnecessary queries. You need to add these templates to the template cache by editing that PHP file. To know which templates, you need to switch debug to on. My hack tells you how many templates are uncached, but not which ones.
Vigile
01-11-2004, 11:48 AM
You have 3 uncached templates, which is causing that page to have 3 extra unnecessary queries. You need to add these templates to the template cache by editing that PHP file. To know which templates, you need to switch debug to on. My hack tells you how many templates are uncached, but not which ones.
Sorry, I know Im getting outside the confines of this topic thread, but Im was able to drop 2 of them but they are being caused by an eval statement to my phpinclude, so I can drop in a variable $shadow instead of long drawn out code. Is there an easy fix for this that wont generate a query? Mind you.. I have added $shadow to about 70 templates so far. So one less query (and an easy fix for it) would be a good thing.
all I've done is eval('$shadow = "' . fetch_template('shadow') . '";');
any help appreciated. If ya want to cut this and move to a proper forum, please do.
Erwin
01-11-2004, 09:32 PM
Sorry, I know Im getting outside the confines of this topic thread, but Im was able to drop 2 of them but they are being caused by an eval statement to my phpinclude, so I can drop in a variable $shadow instead of long drawn out code. Is there an easy fix for this that wont generate a query? Mind you.. I have added $shadow to about 70 templates so far. So one less query (and an easy fix for it) would be a good thing.
all I've done is eval('$shadow = "' . fetch_template('shadow') . '";');
any help appreciated. If ya want to cut this and move to a proper forum, please do.
Instead of adding it to all your templates, if it's in your phpinclude, add it to global.php in the forum directory (at least that's where you do it in vB2, not sure about vB3).
Roderik
01-12-2004, 02:37 PM
Works great!
Page generated in 0.09473 seconds with 8 queries [Server Loads: 0.00 - 0.02 - 0.07]
changed the code to fit my 150px sidebar, see modified code below.
// 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);
if ($stats=@exec('uptime')) {
preg_match('/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/',$stats,$regs);
$serverload=' [Server Loads: <b>'.$regs[1].'</b> - '.$regs[2].' - '.$regs[3].']';
}
$debughtml = "<table width=\"100%\" cellpadding=\"0\" cellspading=\"0\" border=\"0\"><tr><td width=\"150\" nowrap=\"nowrap\"> </td><td algin=\"center\" class=\"smallfont\"><center>Page generated in <b>$totaltime</b> seconds with <b>$query_count</b> queries" . iif($_TEMPLATEQUERIES, " (<b>" . sizeof($_TEMPLATEQUERIES) . "</b> queries for uncached templates)", '') . "$serverload</center></td></tr></table>";
$vartext = str_replace('</body>', "$debughtml\n</body>", $vartext);
}
//Microstats Hack
Limitter
01-13-2004, 11:17 AM
thanks Erwin very nice & easy
L.
Gary King
01-18-2004, 09:29 PM
Maybe you should phrases for this hack, by the way :D
The_Wanderer
01-21-2004, 01:33 PM
just the hack i was looking for ^^
muse.mu
01-21-2004, 03:30 PM
Parse error: parse error in /home/xxxxx/public_html/xxxxxx/includes/functions.php on line 1782
Fatal error: Call to undefined function: is_browser() in /home/xxxxxx/public_html/xxxxxx/global.php on line 59
=/
NTLDR
01-21-2004, 03:41 PM
Don't edit functions.php with Dreamweaver.
muse.mu
01-21-2004, 05:52 PM
Don't edit functions.php with Dreamweaver.
argh. thanks a bunch for the heads up! that is like....the only thing i use :S
can you suggest an alternative please?
NTLDR
01-21-2004, 05:53 PM
I use Textpad (http://www.textpad.com) :)
muse.mu
01-21-2004, 05:59 PM
I use Textpad (http://www.textpad.com) :)
ill give that a try thank you :)
does it have syntax highlighting? if not is there anyting as good with tha feature? i did use HTML kit, but lost it after my XP Pro died ?_?
NTLDR
01-21-2004, 06:01 PM
It has syntax highlighting for all the major languages, including PHP, HTML, C, C++, Java and has a bunch off other addons on its site.
muse.mu
01-21-2004, 06:03 PM
Jeez. thanks for your help, you are bloody fast at replying :p
Gary King
01-21-2004, 07:00 PM
Don't edit functions.php with Dreamweaver.
Yeah, for some reason Dreamweaver automatically modifies certain things.
Oblivion Knight
01-22-2004, 01:35 PM
Excellent stuff, working like a gem.
mharmon
01-23-2004, 12:51 AM
Nice Hack! Thanks Erwin.
sonic3d
01-23-2004, 12:56 AM
nice job
Symbian.info
01-23-2004, 07:14 PM
Installed and works, but I don't get the Server Loads!!??
How can I change that?
xxskullxx
01-23-2004, 09:00 PM
It only shows server loads on linux afaik. If you have a windows server it wont show loads, only queries.
Symbian.info
01-24-2004, 10:36 AM
It only shows server loads on linux afaik. If you have a windows server it wont show loads, only queries.
PHP info: System Linux server 2.4.19 #1
Not a windows system... On Vb 2.X I had a crack that did show the server loads. strange, but ok...
lowlight
01-25-2004, 04:37 AM
Would be great if it had gzip stats too :)
Apostle
01-25-2004, 09:56 AM
This is a very useful hack! I just installed it -- Thanks!
Mike Gaidin
01-25-2004, 08:24 PM
Great feature.
/me clicks install.
Mike Gaidin
01-25-2004, 09:38 PM
If I need to add a template to the cached templates list how do I know which section to add it under. There is a section for:
specialtemplates
globaltemplaes
actiontempates
I have the vertical sidebar on the right side of my page. Which would it fall under? It only appears on the main page. Thanks. :)
97cobracpe
01-28-2004, 11:15 PM
Installed. :)
Gary King
01-29-2004, 05:06 PM
You guys might want to change
$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>";
to $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>";
So that you properly close the <center> tag ;)
Erwin
02-01-2004, 08:36 AM
Thanks Gary! Missed that. Fixed first post.
LeonHartHVA
02-02-2004, 11:01 PM
I can see "Page generated in 0.40848 seconds with 9 queries" but why i can see "server load.."?
Gary King
02-03-2004, 06:51 PM
I can see "Page generated in 0.40848 seconds with 9 queries" but why i can see "server load.."?
It's a part of the Microstats hack.
DeeperImage
02-09-2004, 02:22 AM
I tried installing it on VB3 RC4 and I get this
Parse error: parse error in /home/********/local/home/********/*********/forums/includes/functions.php on line 1838
What am I doing wrong? I am following the instructions to the teeth.
Zelda-King
02-09-2004, 05:49 AM
I have this working fine on RC4. If I give you the benefit of the doubt and say you have indeed followed the instructions correctly, I'd say maybe it's the PHP editor you're using or there's a hack conflict. Something like that.
Gary King
02-09-2004, 11:17 AM
I tried installing it on VB3 RC4 and I get this
Parse error: parse error in /home/********/local/home/********/*********/forums/includes/functions.php on line 1838
What am I doing wrong? I am following the instructions to the teeth.
Don't use Dreamweaver to modify functions.php
DeeperImage
02-09-2004, 11:39 AM
Don't use Dreamweaver to modify functions.php
I am using Wordpad actually. My board is completely unhacked. As original as apple pie. thanks :disappointed:
Boofo
02-09-2004, 11:55 AM
What is the piece of code on that line that is giving the error?
Zelda-King
02-09-2004, 02:20 PM
WordPad can be problematic too, though admittedly I've not noticed any problems on it for vB3 yet. I use Winsyntax. It's free and it does the job.
Gary King
02-09-2004, 06:33 PM
WordPad can be problematic too, though admittedly I've not noticed any problems on it for vB3 yet. I use Winsyntax. It's free and it does the job.
I haven't seen any problems with Wordpad yet, and I think Wordpad is good for a simple editor. It's better than Notepad because it doesn't add extra line breaks, Notepad adds CR / LF but Wordpad is only CR I believe :)
DeeperImage
02-10-2004, 12:17 AM
This is very weird for me, I have no hacks installed whatsoever, I always use wordpad to edit my .php files, and although I am not an expert at hacking php. I have successfully installed many hacks and major additions in the past. So this is mind blowing. But thanks for all the suggestions, really wish I could get this sucka to work, It is one of my fav.
Gary King
02-10-2004, 12:19 AM
This is very weird for me, I have no hacks installed whatsoever, I always use wordpad to edit my .php files, and although I am not an expert at hacking php. I have successfully installed many hacks and major additions in the past. So this is mind blowing. But thanks for all the suggestions, really wish I could get this sucka to work, It is one of my fav.
What is there on the line then? You probably did something wrong ;)
Zelda-King
02-10-2004, 06:13 AM
I haven't seen any problems with Wordpad yet, and I think Wordpad is good for a simple editor. It's better than Notepad because it doesn't add extra line breaks, Notepad adds CR / LF but Wordpad is only CR I believe :)I used to have some trouble with it on vB2 because of how it formatted text. I'm starting to think it was some sort of different version to what I have now (that gives me no trouble) seeing as I'd installed a new OS since vB2 (hence a different WordPad installation). I know this though, the hack works fine for me on RC4 following Erwin's instructions.
DeeperImage
02-11-2004, 12:19 AM
Well, I finally got it to work. I think the problem was wordpad, I used notepad, and it worked perfectly. Thank you so much for this. Thanks to everyone for trying to help. It is extremely easy to install. took me less than 1 minute really. Anyhow it is all working now
this is with 120 people online right now
Page generated in 0.26124 seconds with 8 queries [Server Loads: 0.41 » 0.67 : 0.62]
I love it.
Andreas
02-11-2004, 01:15 AM
IMHO a quite usable editor is Programmers Notepad (http://www.pnotepad.org/)
It's Open Source, has syntax highlighting for several languages, can handle regular expressions, etc.
Reeve of shinra
02-17-2004, 02:46 AM
just installed on rc4 (had to use notepad) but works like a charm! great to see the impact as we *cough* tweak the system. ;)
gmarik
02-17-2004, 02:04 PM
This could be of some use. How about more MySQL DB info, I'mean some diagnostics ...
Gary King
02-17-2004, 07:05 PM
This could be of some use. How about more MySQL DB info, I'mean some diagnostics ...
Like what?
I have :
Page generated in 0.28096 seconds with 9 queries
For FORUM INDEX
and
Page generated in 0.47800 seconds with 18 queries
For vBadvanced INDEX
Gary King
02-17-2004, 10:10 PM
I have :
Page generated in 0.28096 seconds with 9 queries
For FORUM INDEX
and
Page generated in 0.47800 seconds with 18 queries
For vBadvanced INDEX
Yep it can do that to ya :p Try posting in its own support thread, and turn off some features ;)
neah...i don't really care about the queries :)
The place i am hosted has about 300 queries per seccond...so my queries will never be notice :)
M@rkus
02-19-2004, 08:19 AM
Does it work on RC2 or RC3?? I`ve installed it, but i dont see anything of that hack !
Gary King
02-19-2004, 11:12 AM
Does it work on RC2 or RC3?? I`ve installed it, but i dont see anything of that hack !
Yeah it works for RC2 and RC3.
M@rkus
02-19-2004, 01:54 PM
well.. on my first board it works with RC2 but on the other board it won`t show up!
M@rkus
02-19-2004, 02:22 PM
I ve found the problem.. the code was there but the style is another so the code was on a black backround.
Next question. Where else can i place the CODE in the functions.php to get the Stats on another place in the footer?
Sugoi
02-25-2004, 04:42 AM
I get parse error :S
if I delete this line it will not get a error but the mircostats not work well ...
$debughtml .= " (<a href=\"" . htmlspecialchars_uni(SCRIPTPATH) . iif(strpos(SCRIPTPATH, '?') '?')=== false, '?', '?','&') . "tempusage=1\">Template Usage</a>) (<a href=\"" . htmlspecialchars_uni(SCRIPTPATH) . iif(strpos(SCRIPTPATH, '?') '?')=== false, '?', '?','&') . "explain=1\">Explain</a>)<br />\n";
Zelda-King
02-25-2004, 09:53 AM
If you run a search in this thread on the word 'parse' you'll see this has been brought up. It's probably your text editor or something. But you might want to state what version of vBulletin you're using.
Gary King
02-25-2004, 11:13 AM
I get parse error :S
if I delete this line it will not get a error but the mircostats not work well ...
$debughtml .= " (<a href=\"" . htmlspecialchars_uni(SCRIPTPATH) . iif(strpos(SCRIPTPATH, '?') '?')=== false, '?', '?','&') . "tempusage=1\">Template Usage</a>) (<a href=\"" . htmlspecialchars_uni(SCRIPTPATH) . iif(strpos(SCRIPTPATH, '?') '?')=== false, '?', '?','&') . "explain=1\">Explain</a>)<br />\n";
Usually it's also a good idea to show what the parse errors says ;)
Chris M
02-25-2004, 11:46 AM
Installed and working perfectly on RC4 :)
Showthread.php :
Page generated in 0.12244 seconds with 12 queries [Server Loads: 0.27 ? 0.27 : 0.27]
:D
Satan
Sugoi
02-25-2004, 01:37 PM
got this :
Parse error: parse error in /home/jironet/public_html/forum/includes/functions.php on line 1795
Fatal error: Call to undefined function: is_browser() in /home/jironet/public_html/forum/global.php on line 59
I got version RC4
NTLDR
02-25-2004, 01:51 PM
I assume you used dreamweaver to edit the files, use a different editor.
Sugoi
02-25-2004, 02:18 PM
yes i use dreamweaver to search the lines , and edit it .. I'l try another eidtor
EDITED : It works , thank you !
Btw how can I put that line somewhere else ? So not the bottom of the page ! But in the table ?
Gary King
02-25-2004, 06:35 PM
yes i use dreamweaver to search the lines , and edit it .. I'l try another eidtor
EDITED : It works , thank you !
Btw how can I put that line somewhere else ? So not the bottom of the page ! But in the table ?
In what table? Anyways that would require quite a bit more hacking (much more than what you currently have to do for right now) so I would suggest just leaving it how it is right now, it's fine in the footer; also if you move it up then I believe your values will be slightly inaccurate because then the microstats will display before the page is completely loaded.
AlexanderT
02-27-2004, 04:19 PM
Is it possible to split the page load time into time needed for php and time needed for mysql (similar to the 2.x microstat hack)?
Red Blaze
02-27-2004, 09:37 PM
I can't get it to work. I get a parse error and a fatal error.
I'm gonna try to edit the php file in Windows see what I get. I'm using a MAC right now, maybe that's why. >_>; I hate macs.
Gary King
02-27-2004, 09:45 PM
I can't get it to work. I get a parse error and a fatal error.
I'm gonna try to edit the php file in Windows see what I get. I'm using a MAC right now, maybe that's why. >_>; I hate macs.
Macs rule! :D
Red Blaze
03-01-2004, 06:42 PM
Tried to install it on Windows and works perfectly. :)
Boofo
03-01-2004, 06:49 PM
Is it possible to split the page load time into time needed for php and time needed for mysql (similar to the 2.x microstat hack)?
Not with this version, I don't think. ;)
Oblivion Knight
03-03-2004, 01:23 PM
Not with this version, I don't think. ;)http://www.bearfacts2.com/forums
Spill the beans.! ;)
AlexanderT
03-03-2004, 03:19 PM
Page generated in 0.16018701 seconds (87.84% PHP - 12.16% MySQL) with 13 queries.
Would you mind sharing it with us? Btw, I had 25 queries the first time I entered your site, then I had those 13 queries you see above. Both seems like a lot to me given that the unhacked forumindex has something like 8 queries.
Frank
03-03-2004, 03:55 PM
Great hack, cheers :)
Boofo
03-03-2004, 05:12 PM
Would you mind sharing it with us? Btw, I had 25 queries the first time I entered your site, then I had those 13 queries you see above. Both seems like a lot to me given that the unhacked forumindex has something like 8 queries.
I think an unhacked version is like 11 queries, isn't it? 13 queries is damned good with all the stats I have on the forumhome. ;) And 25 is when the stats cache gets updated (every 10 minutes).
You guys will have to go to the site to get it. I can't release it here since it basically is just the version Teck released for vB2 re-worked for vB3. ;)
AlexanderT
03-04-2004, 06:20 AM
That is from my forumhome, unhacked, user logged in:
Page generated in 0.16946 seconds with 7 queries [Server Loads: 0.29 » 0.23 : 0.25]
AlexanderT
03-04-2004, 06:20 AM
You guys will have to go to the site to get it. I can't release it here since it basically is just the version Teck released for vB2 re-worked for vB3. ;)
Thanks, will do!
Boofo
03-04-2004, 07:02 AM
That is from my forumhome, unhacked, user logged in:
Page generated in 0.16946 seconds with 7 queries [Server Loads: 0.29 ? 0.23 : 0.25]Which RC version are you using? Because the lowest I have ever seen it is 9.
Gary King
03-04-2004, 06:38 PM
Which RC version are you using? Because the lowest I have ever seen it is 9.
I've already reached 7 as well, for I believe all the vB 3 versions or at least most of them.
Installed on RC4.
Works like a charm, nice hack
Much appriciated :D
I only installed it to view the number of queries. Can anybody explain the other info to me:
Page generated in 0.42810 seconds with 8 queries [Server Loads: 2.13 ? 1.77 : 1.46]
I mean the server loads part.
Tnx
Is it possible to split the page load time into time needed for php and time needed for mysql (similar to the 2.x microstat hack)?
Do a search for Microstats, there is a version for VB3.
neocorteqz
03-20-2004, 01:30 AM
Parse error: parse error in /home/neocort2/public_html/includes/functions.php on line 1813
Fatal error: Call to undefined function: is_browser() in /home/neocort2/public_html/global.php on line 59
and i don't use dreamweaver. I use the one built into CuteFTP, never had a problem before.
and line 1813 is else
vB 3.0 RC 3.
Edit, tried rehacking with wordpad. No go.
edit 2, Working with the current stable release. :)
PlenoJure
03-21-2004, 08:20 AM
Installed & working quite well on gold :)
Thanks!
neocorteqz
03-22-2004, 07:08 AM
Installed & working quite well on gold :)
Thanks!
I know it's off topic, but Howdy from a close florida resident. :)
kyrnel
03-22-2004, 06:22 PM
Page generated in 0.16578 seconds with 11 queries [Server Loads: 0.02 ? 0.09 : 0.13]
I guess that's good for a forum with 20k members and 500k posts.
Nice hack, thanks!
Preds
03-22-2004, 09:52 PM
Nice, installed on my vB 3.0.0 Gold board without incident.
BTW, I only have 3 hacks installed (the Welcome Hack, the Who Was Online Dynamic Hack, and this one)... are these numbers OK?
Page generated in 0.13595 seconds with 14 queries [Server Loads: 0.60 » 0.46 : 0.48]
At the time 2 users were OL. Is 14 queries high? If so what would cause that?
BarBeQue
03-27-2004, 12:18 PM
Ever since i installed the sidebar hack i get 1 uncached template:
Page generated in 0.37613 seconds with 11 queries (1 queries for uncached templates) [Server Loads: 0.63 ? 1.10 : 1.84]
Hence my obvious conclusion is that it's the sidebar template that's uncached (yes indeed, i'm quite the detective ;) ).
Anyway, how can i add this template to the cache?
lifesourcerec
04-01-2004, 09:20 AM
Very nice. 8 queries here. But then again, just installed the new version with 1 hack.
BarBeQue
04-02-2004, 04:55 PM
Ok, i solved my own problem. Posted the fix in the sidebar thread (for the peepz that use search and stumble on this thread)
Tnx again Erwin, your nice hack showed me the uncached template without needing to turn debug on :D
surfhog
04-08-2004, 09:54 PM
WOW wee yippy
Thanks Erwin, at least I got one hack from this board to work :)
neocorteqz
04-08-2004, 10:49 PM
small question. is 13 queries too much?? lol. Actually i'm serious, i think the default install was something like 8 or 9 on forum home.
cerebro
04-09-2004, 11:14 PM
Nice hack, just install in VB3 gold.
Loyalty4Life
04-15-2004, 12:12 AM
Thanks Erwin!
/me likes and clicks install.
kmike
04-17-2004, 06:42 PM
Perfect hack.
I just want to suggest a little tweak which will eliminate exec call (and associated "fork" system call). It will work at least on Linux, not sure about freebsd.
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>";
$vartext = str_replace('</body>', "$debughtml\n</body>", $vartext);
}
Hello,
I am a newbie myself,but you guys are amazing. I applied ALL the hacks with the directions I have been provided and my forum houses a portal (VBadvanced),as well as over 18 different hacks and numerous custom templates. With all that said,this is what I am running at right now with 10 members and 3 guests:
Page generated in 0.11039 seconds with 9 queries [Server Loads: 0.64 » 0.39 : 0.34]
Now I know I can lower this some as I have made no attempt at lower the queries. lol Any suggestions for lowering queries?
I have 2 uncached templates. I don't know how to cache a template. That is something I haven't done yet. I could use some guidance with this.
Erwin
04-21-2004, 10:03 AM
Perfect hack.
I just want to suggest a little tweak which will eliminate exec call (and associated "fork" system call). It will work at least on Linux, not sure about freebsd.
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>";
$vartext = str_replace('</body>', "$debughtml\n</body>", $vartext);
}
Great idea!!! :)
I've updated the first post. People feel free to update to the code in the 1st post. It should lessen the load slightly.
buro9
04-21-2004, 10:23 AM
Thanks for the update... appreciated that you keep us up to date with improvements :)
Nice tweak, and updated in no time :)
d3nnis
04-21-2004, 10:46 AM
I have 2 uncached templates. I don't know how to cache a template. That is something I haven't done yet. I could use some guidance with this.
yah i would like to learn too!
d3nnis
04-21-2004, 01:25 PM
i followed this codes :
// 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>";
$vartext = str_replace('</body>', "$debughtml\n</body>", $vartext);
}
//Microstats Hack
but it does not shows the server load except number of queries executed in xxx secs anymore.
Quote:
Originally Posted by iguanairs
I have 2 uncached templates. I don't know how to cache a template. That is something I haven't done yet. I could use some guidance with this.
yah i would like to learn too!
Just bumping as there are now 2 of us trying to figure this out. How do we cache a page?
Bump
I know this is easy to do. Can I query it? I searched these forums and when you type in cache template,etc you get hundreds of listings,but not telling how! Please answer this. I know 90% of you know how to do it.
kmike
04-21-2004, 07:02 PM
d3nnis:
Did server load show before? What's your server OS?
d3nnis
04-22-2004, 12:22 AM
d3nnis:
Did server load show before? What's your server OS?
yup before i change to the new codes... the server load does show.
using redhat 7.3 :nervous:
Hm! Very simple, and looks pertty good. I'll probaly use this....(Clicks Install)
Erwin
04-22-2004, 03:00 AM
Quote:
Originally Posted by iguanairs
I have 2 uncached templates. I don't know how to cache a template. That is something I haven't done yet. I could use some guidance with this.
yah i would like to learn too!
Just bumping as there are now 2 of us trying to figure this out. How do we cache a page?
To cache a template, you need to find out which ones are not being cached. Then you add it to the top of the PHP file being run, in the section where it lists templates to be cached.
I may add a feature to this hack so that uncached templates show up with names.
kmike
04-22-2004, 03:06 AM
d3nnis:
Do you have access to server's shell? If so, what's output of "ls -l /proc/loadavg" and
"ls -ld /proc" ?
Anyway, you might want to revert to previous version of the hack for the time being...
Jolten
04-22-2004, 03:21 AM
/me clicks install. Thanks Erwin.
d3nnis
04-22-2004, 04:56 AM
d3nnis:
Do you have access to server's shell? If so, what's output of "ls -l /proc/loadavg" and
"ls -ld /proc" ?
Anyway, you might want to revert to previous version of the hack for the time being...
the server is owned by me. I will check it out tonite when i am back home. :)
d3nnis
04-22-2004, 04:56 AM
To cache a template, you need to find out which ones are not being cached. Then you add it to the top of the PHP file being run, in the section where it lists templates to be cached.
I may add a feature to this hack so that uncached templates show up with names.
that will be great!
by the way what kind of problem does uncached templates gives? increase server load?
kmike
04-22-2004, 08:26 AM
by the way what kind of problem does uncached templates gives? increase server load?
Each vb3 page is getting all "cached" templates in a batch, in one SQL query. Every uncached template needs separate query to run, thus increasing load on SQL server.
To find out what templates are uncached, one have to run the script in debug mode. Of course tt could be done simply by putting $debug=1; at the beginning of the script, but you don't want to scare your users, do you? :) So you can install one of the following hacks to restrict debug mode to certain users/groups/IPs:
https://vborg.vbsupport.ru/showthread.php?t=59605
https://vborg.vbsupport.ru/showthread.php?t=61242
After installation, you'll have a table of template usage at the bottom of debugged page, with uncached templates highlighted.
To cache template simply edit debugged script and add template name to globaltemplates array which is usually defined at the very top of the script.
d3nnis
04-22-2004, 11:21 AM
d3nnis:
Do you have access to server's shell? If so, what's output of "ls -l /proc/loadavg" and
"ls -ld /proc" ?
Anyway, you might want to revert to previous version of the hack for the time being...
here's my output
root@xxx [~]# ls -l /proc/loadavg
-r--r--r-- 1 root root 0 Apr 22 20:20 /proc/loadavg
root@xxx [~]# ls -ld /proc
dr-xr-xr-x 286 root root 0 Apr 22 07:06 /proc/
d3nnis
04-22-2004, 01:56 PM
Each vb3 page is getting all "cached" templates in a batch, in one SQL query. Every uncached template needs separate query to run, thus increasing load on SQL server.
To find out what templates are uncached, one have to run the script in debug mode. Of course tt could be done simply by putting $debug=1; at the beginning of the script, but you don't want to scare your users, do you? :) So you can install one of the following hacks to restrict debug mode to certain users/groups/IPs:
https://vborg.vbsupport.ru/showthread.php?t=59605
https://vborg.vbsupport.ru/showthread.php?t=61242
After installation, you'll have a table of template usage at the bottom of debugged page, with uncached templates highlighted.
To cache template simply edit debugged script and add template name to globaltemplates array which is usually defined at the very top of the script.
i written my TOS page , http://forums.keeptouch.net/tos.php using this code :
<?php
$globaltemplates = array(
'navbar',
'tos'
);
require_once('./global.php');
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('tos') . '");');
?>
Previously I did not add :
$globaltemplates = array(
'navbar',
'tos'
);
so it appears as 1 uncached template but after i added the above code, it does not appears anymore. Am I on the right track?
kmike
04-22-2004, 05:13 PM
root@xxx [~]# ls -l /proc/loadavg
-r--r--r-- 1 root root 0 Apr 22 20:20 /proc/loadavg
root@xxx [~]# ls -ld /proc
dr-xr-xr-x 286 root root 0 Apr 22 07:06 /proc/
Hmm, not sure what's going on here. Do you have safe mode enabled, by chance?
What is output of this script:
<?php
echo "file_get_contents: ".function_exists(file_get_contents)."<br>";
echo "safe_mode: ".ini_get(safe_mode)."<br>";
?>
As to templates caching, you've got it absolutely right.
d3nnis
04-23-2004, 12:20 AM
Hmm, not sure what's going on here. Do you have safe mode enabled, by chance?
What is output of this script:
<?php
echo "file_get_contents: ".function_exists(file_get_contents)."<br>";
echo "safe_mode: ".ini_get(safe_mode)."<br>";
?>
As to templates caching, you've got it absolutely right.
nope, safe mode definitely not on :)
my output of this script is
file_get_contents: 1
safe_mode:
kmike
04-23-2004, 03:57 AM
Very weird.
Ok, what does "cat /proc/loadavg" show when run in the command line?
And since we're so deep in testing, what's output of this php script:
<?php
echo file_get_contents("/proc/loadavg");
?>
d3nnis
04-23-2004, 05:39 AM
Very weird.
Ok, what does "cat /proc/loadavg" show when run in the command line?
And since we're so deep in testing, what's output of this php script:
<?php
echo file_get_contents("/proc/loadavg");
?>
i got a open_basedir restriction error.
i cannot test cat /proc/loadavg via the command line cos i am not at home. anymore command line commands to test? i do one shot upon reaching home.
kmike
04-23-2004, 08:12 AM
Ok, we're getting somewhere.
If you want to use latest version of the hack, you'll have to add "/proc" to the list of open_basedir restricted directories. It's done through editing your httpd.conf, or php.ini, or through .htaccess (not sure about last one though). Or, if you want to save the hassle, just roll back to previous version of hack.
d3nnis
04-23-2004, 03:33 PM
Ok, we're getting somewhere.
If you want to use latest version of the hack, you'll have to add "/proc" to the list of open_basedir restricted directories. It's done through editing your httpd.conf, or php.ini, or through .htaccess (not sure about last one though). Or, if you want to save the hassle, just roll back to previous version of hack.
thanks, i enable my domain, keeptouch.net and forums.keeptouch.net to allow open_basedir restriction via whm. i can see the server loads now :)
d3nnis
05-01-2004, 07:45 PM
kmike, i just migrated to a new server running on freeBSD 4.9... the new codes (server loads not showing again) doesn't works anymore... any resolution?
root# ls -ld /proc
dr-xr-xr-x 1 root wheel 512 May 2 04:45 /proc
root# ls -l /proc/loadavg
ls: /proc/loadavg: No such file or directory
seems like i need this loadavg... where can i get it?
Nice hack!
I've got my footer setup with an inside table with a dark border surrounding the content table. Is there a way that I could move the microstats up so it under the vb copyright line?
http://www.skinnylizard.com/verge/images/footer.gif
http://www.skinnylizard.com/verge
Nevermind, I figured it out...
I made it a link in my footer that goes to javascript:void(0); and the mouse over lists the page stats...
I'll share the code modifications if anyone is interested.
Boofo
05-05-2004, 01:53 PM
Nevermind, I figured it out...
I made it a link in my footer that goes to javascript:void(0); and the mouse over lists the page stats...
I'll share the code modifications if anyone is interested.
I'd like to see this. ;)
In my footer template, I have a link that shows the forum time. You need to find a comon element that's in your footer and nowhere else in you site or this will cause problems.
<a style="text-decoration:none" title="All times are GMT$timediff. The time now is $timenow" href="javascript:void(0);"><b>Forum Time</b></a>
In the functions.php file, I changed Erwin's $vartext variable to read.
$vartext = str_replace('<b>Forum Time</b></a>', "<b>Forum Time</b></a> | <a style=\"text-decoration:none\" title=\"$debughtml\" href=\"javascript:void(0);\"><b>Page Stats</b></a><br>",$vartext);
I changed the $debughtml variable to only show total time and query count, it can stay as it was in Erwin's original, but all the text formatting needs to be removed becuase the title tag will show all formatting tags as text.
$debughtml = "Page generated in $totaltime seconds with $query_count queries";
kmike
05-05-2004, 07:14 PM
d3nnis: freebsd doesn't have /proc/loadavg, you'll have to resort to the previous version of this hack which invokes "loadavg" command.
d3nnis
05-06-2004, 08:08 AM
d3nnis: freebsd doesn't have /proc/loadavg, you'll have to resort to the previous version of this hack which invokes "loadavg" command.
ohh okie...
ermm i dun have the codes anymore...
anyone has it?
joeychgo
05-06-2004, 01:08 PM
ok on my VBadv page mine says:
Page generated in 0.23882 seconds with 19 queries (2 queries for uncached templates) [Server Loads: 0.82 0.92 : 1.23]
and on my forum home I get:
Page generated in 0.27978 seconds with 15 queries (2 queries for uncached templates) [Server Loads: 2.87 1.33 : 1.36]
Is this good or bad???
d3nnis
05-13-2004, 11:07 PM
hello anyone got the old codes for this?
d3nnis
05-15-2004, 03:12 PM
anyone still got the old codes before Erwin updated the first thread using kmike's codes??
d3nnis
05-15-2004, 03:28 PM
nvm, i found it on page two.. luckily someone reposted...
Bulent Tekcan
05-30-2004, 02:21 PM
I can't see server load,why ?
My System is Linux Apache/2.0.48 (Fedora); PHP v4.3.6; apache2handler,v4.0.20-standard
Thanks
Bulent Tekcan
05-31-2004, 12:30 PM
Any comment ? Or idea ?
neocorteqz
05-31-2004, 08:37 PM
Any comment ? Or idea ?
Try with a fresh files and rehack? Only suggestion i have, seeing as I have no clue to why it is not working.
Bulent Tekcan
05-31-2004, 08:40 PM
I try 3-4 times,before my server Apache 1.3.9 but new one 2.0.49 maybe different source,I don't know....
jancarlo
06-02-2004, 11:54 AM
@ Erwin
cannot be had the modification in a txt? who has Mac does not succeed to copy in php code.
thanks
jancarlo
neocorteqz
06-04-2004, 07:16 AM
@ Erwin
cannot be had the modification in a txt? who has Mac does not succeed to copy in php code.
thanks
jancarlo
Hope erwin doesn't mind.
jancarlo
06-04-2004, 12:03 PM
@ neocorteqz, hour all ok! :D
thanks and CIAO
jancarlo
neocorteqz
06-04-2004, 03:43 PM
@ neocorteqz, hour all ok! :D
thanks and CIAO
jancarlo
Glad i could help. :)
jancarlo
06-13-2004, 11:46 AM
And if you wanted others usergroups? How I must make? Type also
usergroups 12?
if ($bbuserinfo[usergroupid]==6) {
thanks
jancarlo
neocorteqz
06-13-2004, 03:55 PM
And if you wanted others usergroups? How I must make? Type also
usergroups 12?
if ($bbuserinfo[usergroupid]==6) {
thanks
jancarlo
$bbuserinfo[usergroupid] == 6 and $bbuserinfo[usergroupid] == 12
jancarlo
06-13-2004, 07:19 PM
$bbuserinfo[usergroupid] == 6 and $bbuserinfo[usergroupid] == 12
it does not go well :ermm:
it is looked at alone with group 6
jancarlo
Fenriz
06-17-2004, 07:59 AM
Could anyone tell, how I can add results of this hack right after $vboptions[copyrighttext] in footer template?
Can't see the server load neither.
Server OS/PHP Linux; PHP v4.3.0; apache Safe Mode
Any suggestions?
thanks in advance
barnest2
06-17-2004, 07:49 PM
Can't see the server load neither.
Same thing with me. Someone mentioned that the previous version of the hack didn't need adding /proc into your ini files...can someone please post the original hack again?
Erwin
06-17-2004, 08:01 PM
Same thing with me. Someone mentioned that the previous version of the hack didn't need adding /proc into your ini files...can someone please post the original hack again?
I added the old version to the first post. :) You can now choose between Version 1.0 and Version 1.1.
barnest2
06-17-2004, 08:40 PM
I added the old version to the first post. :) You can now choose between Version 1.0 and Version 1.1.
MUCH appreciated! That did the trick. Version 1.1 didn't show my server loads but version 1.0 does. :up:
atomic fireball
06-27-2004, 04:37 PM
Thanks, Erwin.
Worked like a charm!
ShiningArcanine
07-07-2004, 08:53 PM
Erwin, why not just replace $vartext with $output and then place the hack in phpinclude_end? It eliminates the need to hack functions.php and is executed right below where you recommend placing the hack.
Erwin
07-07-2004, 11:40 PM
Erwin, why not just replace $vartext with $output and then place the hack in phpinclude_end? It eliminates the need to hack functions.php and is executed right below where you recommend placing the hack.
Because putting it in phpinclude_end may not give you an accurate count of queries perhaps? And it may not work? I haven't thought about it, and haven't tried it - maybe you can try and compare the 2 and see if there is a difference.
ShiningArcanine
07-08-2004, 01:22 PM
I tried it; there is no difference in query count and it works like a charm.
Erwin
07-08-2004, 10:38 PM
There you go. :) Never thought it would work as well - the vB3 debug stats are all in functions.php, hence the reason why this hack went to the same spot too.
SaN-DeeP
07-10-2004, 02:49 AM
hi erwin thnx for the nice hack :)
Version 1.1 works fine for me
Page generated in 0.21845 seconds with 10 queries [Server Loads: 0.24 0.23 : 0.18]
just a small question: as you specified in ur instructions.
Information shown:
1) Page loading times
2) Number of Queries
3) Server Loads
4) Any Uncached Templates
were are these uncached templates seen ?
Regards,
Jolten
07-10-2004, 04:25 AM
If their are uncached templates the number of them will be shown at the end of the line.. e.g. "2 queries for uncached templates"
Erwin
07-14-2004, 12:30 PM
UPDATE:
-----------
Version 1.2 (servers with proc - more efficient) or Version 1.02 (servers without proc - still works)
-> now the names of all uncached templates show up - helpful to find and cached any uncached templates to save queries. :)
On my forum i have 1.2. Now i hear of a 1.02. WTF ? What do i need to modify to have the new version, also, what new things this new version has ?
the Sandman
07-21-2004, 05:20 PM
All of a sudden, I'm getting erroneous, very large load times listed:
Page generated in 18,859 seconds with 11 queries [Server Loads: 0.69 1.66 : 2.03]
Ocean
07-21-2004, 05:46 PM
All of a sudden, I'm getting erronious, very large load times listed:
I'm seeing those as well, but so far, I have only seen them on the Login Redirect screen.
Erwin
07-21-2004, 10:48 PM
All of a sudden, I'm getting erroneous, very large load times listed:
Odd - which version are you using? The proc one (1.2) or the older non-proc one (1.02)? I'm using version 1.2 since my server has proc, and it's working normally.
the Sandman
07-21-2004, 11:15 PM
I'm also using version 1.2. As far as I know, it was working normally, and then I suddenly noticed these crazy values. I did go ahead and re-upload the file to my server, but that made no difference. :ermm:
Kathy did just have Apache recompiled on the server - could it be related to that?
Erwin
07-21-2004, 11:23 PM
I'm also using version 1.2. As far as I know, it was working normally, and then I suddenly noticed these crazy values. I did go ahead and re-upload the file to my server, but that made no difference. :ermm:
Kathy did just have Apache recompiled on the server - could it be related to that?
No, because my Apache was recently recompiled too.
the Sandman
07-21-2004, 11:31 PM
I swapped in version 1.02 in place of 1.2, but the high page generation values remained. I swapped 1.2 back in. I guess it's a problem in the server...
Ocean
07-22-2004, 02:02 PM
I swapped in version 1.02 in place of 1.2, but the high page generation values remained. I swapped 1.2 back in. I guess it's a problem in the server...
That doesn't explain why I get it on the Login Redirect pages. And they've been that way from the start.
Does anyone else have that?
the Sandman
07-22-2004, 05:17 PM
Something else weird I noticed. I copied these server load averages from the AdminCP:Server Load Averages 283 244 203 | 41 Users Online (12 members and 29 guests) At the same time the Microstats read:Page generated in 20,799 seconds with 11 queries [Server Loads: 3.35 : 2.51 : 2.04]There's quite a discrepancy in the server loads averages reported and it appears (I hope) that the correct values are from Microstats and the AdminCP values are way off, most likely by a factor of 100...
AN-net
07-22-2004, 05:43 PM
anyone else notice the seconds are being reported like that>_> it is susposed to be a demical and most of us hope it is a decimal.
the Sandman
07-22-2004, 06:03 PM
I still think it's a server issue. I uninstalled Erwin's Microstats and installed Teck's Microstats. I'm still getting the ridiculously high page generation times from Microstats and the screwy server load averages in the AdminCP...
HakkieDEV
07-25-2004, 02:15 PM
Awesome hack mate, using it with pleasure!
/me clicks install
jancarlo
07-25-2004, 04:20 PM
@ Erwin
Seen the new version, why you do not make also a txt? With Mac I do
not succeed to copy from windows PHP Code.
thanks
jancarlo
Modin
07-26-2004, 04:28 AM
this is a great hack mate, nice work :up:
deathemperor
07-26-2004, 08:12 AM
time to take care of the loading average of my board
/me clicks install
Michael Morris
07-26-2004, 08:49 AM
Doesn't work on RC4
integra99
07-26-2004, 04:31 PM
1.2 works fine on 3.0.1
Littlebit
07-26-2004, 04:47 PM
Hi Erwin,
I'd like to use your hack and was wondering if it works fine with 3.0.3?
Erwin
07-27-2004, 01:30 AM
Hi Erwin,
I'd like to use your hack and was wondering if it works fine with 3.0.3?
Yes.
AnhTuanCool
07-27-2004, 03:59 AM
Wait, I've just installed it, absolutely perfect, but the code is placed at the very bottom of the page, I don't want it over there, is there someway to bring it up or place it somewhere else? :|
Erwin
07-27-2004, 03:22 PM
Wait, I've just installed it, absolutely perfect, but the code is placed at the very bottom of the page, I don't want it over there, is there someway to bring it up or place it somewhere else? :|
It has to be at the bottom because it has to read everything that gets parsed out first to get the correct time and number of queries. You could use a float tag to float it elsewhere I suppose.
AnhTuanCool
07-27-2004, 03:32 PM
Oh, I see. ;)
Could you detail how to use a float tag to me? Thx ^__^
Littlebit
07-27-2004, 08:50 PM
Yes. thank you Erwin for this, I'm installing :classic:
Ted S
08-01-2004, 11:23 PM
For some reason on one of my styles the data line appears twice (identical valeus), other styles load about as quick with the same query count but only show the results once, is this anything to worry about?
lifesourcerec
08-09-2004, 01:37 PM
It has to be at the bottom because it has to read everything that gets parsed out first to get the correct time and number of queries. You could use a float tag to float it elsewhere I suppose.
Mine list at the top and bottom. How can I get rid of that?
Erwin
08-10-2004, 03:30 AM
The data line is based on the </body> tag which should be the last tag before </html> - so if your templates have multiple </body> tags (which is bad coding) then you will get more than 1 occurrence of the info.
BamaTech
11-19-2004, 04:08 PM
nice was looking for this
thanks for the effort and the share
I'm fooling around with some hacks on a test server that have lots of queries. Thanks Erwin for helping me determine just how many with this hack (not to mention uncached templates).
I've put them into a HEAP table so that they lessen the load. Do you think a query to a HEAP table is even worth counting? Can it get me in trouble with high load on a production board?
Torqued
12-03-2004, 03:29 PM
I installed 1.2 and it gave me the names of the uncached templates, but not server load..
So I installed 1.02 and it gives me server load and the # of uncached templates, but not the names..
should 1.02 be showing me the names as well?
I am on v3.03
Erwin
12-03-2004, 11:31 PM
I installed 1.2 and it gave me the names of the uncached templates, but not server load..
So I installed 1.02 and it gives me server load and the # of uncached templates, but not the names..
should 1.02 be showing me the names as well?
I am on v3.03
Weird, both should show server loads and uncached template names.
Torqued
12-04-2004, 01:23 AM
Weird, both should show server loads and uncached template names.
That's what I thought. I just doublechecked and reinstalled the 1.02 code and am not getting the uncached template names. :(
Any ideas?
Torqued
12-04-2004, 01:44 AM
Ok. I fixed it... don't know why it works, but it does! LOL
I took the code @ the bottom of 1.2 for evaluating/displaying uncached templates and put that code in the same spot in 1.02 and it works! :)
Now how is it that I fix uncached templates? I'm running vBAdvanced CMPS 1.0.0 and vBLinks 1.0.0. The two uncached templates are related to the links directory.
KW802
12-04-2004, 05:38 PM
Any thoughts on if we don't see the server load with either version?
Erwin
12-05-2004, 09:53 PM
Ok. I fixed it... don't know why it works, but it does! LOL
I took the code @ the bottom of 1.2 for evaluating/displaying uncached templates and put that code in the same spot in 1.02 and it works! :)
Now how is it that I fix uncached templates? I'm running vBAdvanced CMPS 1.0.0 and vBLinks 1.0.0. The two uncached templates are related to the links directory.
Add to the list of cached templates at the top of the PHP file (each uncached templates add 1 unnecessary database query).
Delphiprogrammi
12-17-2004, 09:25 PM
nice one i clicked install
MindTrix
12-18-2004, 01:37 PM
Dont know if this has been covered, but if you have shoutbox installed it shows up in the bottom of that aswell on the forum homepage. Just thought i would mention, other wise its nice and simple thanks. 23 querys on main page, ouch.
This hack is the bomb if you do any real hacking. Must have.
SaN-DeeP
01-04-2005, 09:54 AM
for some reason (i am not sure)
[Server Loads: 0.57 0.64 : 0.51] -> this line is not visible on my new server ?
i am on a VPS solution on this server any idea ?
Help is appreciated.
Page generated in 0.23279 seconds with 8 queries -> only this line appears not the server loads.
I have tried using both the code versions mentioned.
Regards,
Rhoads
01-09-2005, 03:51 PM
Oke nice hack, but I wonder myself is this bad or good, and wat can I do if it's bad, I run 15 modules
Page generated in 0,85302 seconds with 26 queries (2 queries for uncached templates)
Uncached templates: adv_portal_ (1)
Uncached templates: board_inactive_warning (1)
You need to add those templates at the beginning of the php page that you saw the message on. It will speed up the page and reduce the number of queries to the database which will be good for all of your vb installation.
Erwin
01-09-2005, 08:55 PM
You need to add those templates at the beginning of the php page that you saw the message on. It will speed up the page and reduce the number of queries to the database which will be good for all of your vb installation.
Except for "board_inactive_warning" template - that's when your board is turned off, and there's no need to globally cache it. :)
Rhoads
01-09-2005, 09:02 PM
You need to add those templates at the beginning of the php page that you saw the message on. It will speed up the page and reduce the number of queries to the database which will be good for all of your vb installation.
Oke Thanks for the answer.
But can you explain a litllebit how it's works.
Thnx
SaN-DeeP
01-17-2005, 10:01 AM
for some reason (i am not sure)
[Server Loads: 0.57 0.64 : 0.51] -> this line is not visible on my new server ?
i am on a VPS solution on this server any idea ?
Help is appreciated.
Page generated in 0.23279 seconds with 8 queries -> only this line appears not the server loads.
I have tried using both the code versions mentioned.
Regards,
bumping back :) i am still facing this problem.
Regards,
Erwin
01-17-2005, 10:39 AM
bumping back :) i am still facing this problem.
Regards,
Talk to your host. It may have been disabled.
SaN-DeeP
01-17-2005, 01:28 PM
Talk to your host. It may have been disabled.
Another forum running on different VPS is not facing this problems..
Server loads etc., is perfectly visible on there end.
Regards,
Erwin
01-17-2005, 09:18 PM
Another forum running on different VPS is not facing this problems..
Server loads etc., is perfectly visible on there end.
Regards,
Then I don't know why it doesn't show up for you to be honest. Do server loads show up in your Admin CP?
smsmasters
01-21-2005, 01:05 PM
For instance, in the vbchat room hack, and some other custom pages on my forum, I get double instances of this...
nautiqeman
01-21-2005, 05:48 PM
Page generated in 0.31904 seconds with 69 queries (8 queries for uncached templates) [Server Loads: 0.29 » 0.48 : 0.52]
how do I get the Names of the uncached templates to show up?
Erwin
01-21-2005, 10:58 PM
Page generated in 0.31904 seconds with 69 queries (8 queries for uncached templates) [Server Loads: 0.29 ? 0.48 : 0.52]
how do I get the Names of the uncached templates to show up?
If you use the latest version of the hack the names should show up.
nautiqeman
01-21-2005, 11:10 PM
I've added in the 1.02 but it's not still not showing up -- any ideas why it might not?
Erwin
01-22-2005, 10:53 AM
Use 1.2. 1.02 is not optimized and is to be used only for certain servers.
trackpads
01-22-2005, 02:07 PM
Excellent! Thanks and installed!
nautiqeman
01-23-2005, 02:29 PM
Use 1.2. 1.02 is not optimized and is to be used only for certain servers.
but don't you need proc installed? how do I know if it's installed and if it's not, then how do I get it to install it? thanks
yoyoyoyo
01-23-2005, 03:18 PM
I think that every one of erwin's hacks should be part of the next VBulletin official release :)
BamaStangGuy
01-25-2005, 04:57 AM
I have red hat enterprise 3 and version 1.2 of this hack doesnt show load averages yet there is a /proc when I type it in via ssh
What should I look for?
Jolten
02-20-2005, 11:00 PM
I've got several pages powered by vb that aren't standard vb pages. I've called global.php and the header and footer display properly but the ministats don't show on the non-vb pages. Any clue what I need to include to get them to work out side the forums?
Thanks
SaN-DeeP
02-25-2005, 07:46 AM
Then I don't know why it doesn't show up for you to be honest. Do server loads show up in your Admin CP?
I upgraded our forums to 3.0.7 from 3.0.3 and version 1.02 displays server loads properly now.. although there is a small problem.
The uncached template name, does not displays in version 1.02
I can get something like this on forums/index.php
Page generated in 0.43167 seconds with 9 queries (1 queries for uncached templates) [Server Loads: 0.01 ? 0.15 : 0.25]
Note: It does not displays which uncached template :)
Thanks for your time Erwin for this great hack.
Regards,
Guest190829
02-26-2005, 03:17 AM
Need this for my test board, good job as always Erwin!
djjeffa
02-26-2005, 10:41 PM
great hack I just installed it eazy but the one problem is it messes up my footer on my style.
also is this good or bad for my index? Page generated in 0.20314 seconds with 14 queries [Server Loads: 0.55 » 0.50 : 0.61]
i do have a few hacks
djjeffa
02-28-2005, 01:56 AM
great hack I just installed it eazy but the one problem is it messes up my footer on my style.
also is this good or bad for my index? Page generated in 0.20314 seconds with 14 queries [Server Loads: 0.55 ? 0.50 : 0.61]
i do have a few hacks
bump?
is ther a way maybe i could add another bar at the botom or somthing to make this work?
neocorteqz
02-28-2005, 08:49 AM
great hack I just installed it eazy but the one problem is it messes up my footer on my style.
also is this good or bad for my index? Page generated in 0.20314 seconds with 14 queries [Server Loads: 0.55 ? 0.50 : 0.61]
i do have a few hacks
That is fine. At least to me that is fine, there are some who are able to cut queries and have below 10 queries on forum home.
bump?
is ther a way maybe i could add another bar at the botom or somthing to make this work?
You can maybe just put it under the copyright info? instead of the footer?
djjeffa
02-28-2005, 11:06 AM
You can maybe just put it under the copyright info? instead of the footer?
yea i tried and it didnt work right so i just removed the images
zachlee
03-05-2005, 11:35 PM
is there a way to incorporate this hack, to also include a line from admincp page?
I would like it to call the function that looks up info such as:
8 Users Online (1 members and 7 guests)
which normally is located after the server load average info.
Thanks!
-Zach
neocorteqz
03-05-2005, 11:53 PM
is there a way to incorporate this hack, to also include a line from admincp page?
I would like it to call the function that looks up info such as:
8 Users Online (1 members and 7 guests)
which normally is located after the server load average info.
Thanks!
-Zach
That is already on forum home. Located within the logged in users.
But I'm sure someone knows how to add it.
Erwin
03-06-2005, 08:53 PM
is there a way to incorporate this hack, to also include a line from admincp page?
I would like it to call the function that looks up info such as:
8 Users Online (1 members and 7 guests)
which normally is located after the server load average info.
Thanks!
-Zach
Different hack - I also wrote that one - check in my profile to show this on every page.
kcadd
03-09-2005, 04:59 PM
* kcadd clicks install :D
sapper6fd
03-14-2005, 05:37 AM
Stats for index.php with CMPS 1.0.1
Page generated in 0.21693 seconds with 23 queries (2 queries for uncached templates) [Server Loads: 3.89 1.83 : 1.59]
Uncached templates: adv_portal_latesttopicbits (5)
Uncached templates: adv_portal_latesttopics (1)
WOW.... How do I cut that back? How do I tell what pages arnt cached, and how do I cache them? BTW, thats with 3 people on the forum, shared server.
neocorteqz
03-14-2005, 06:30 AM
Stats for index.php with CMPS 1.0.1
Page generated in 0.21693 seconds with 23 queries (2 queries for uncached templates) [Server Loads: 3.89 1.83 : 1.59]
Uncached templates: adv_portal_latesttopicbits (5)
Uncached templates: adv_portal_latesttopics (1)
WOW.... How do I cut that back? How do I tell what pages arnt cached, and how do I cache them? BTW, thats with 3 people on the forum, shared server.
Ouch
And you can tell what is uncached by looking at your post.
Uncached templates: adv_portal_latesttopicbits (5)
Uncached templates: adv_portal_latesttopics (1)
sapper6fd
03-14-2005, 02:38 PM
Ouch
And you can tell what is uncached by looking at your post.
Uncached templates: adv_portal_latesttopicbits (5)
Uncached templates: adv_portal_latesttopics (1)
Well I got those quiries, but what about the other 21
neocorteqz
03-14-2005, 05:10 PM
Well I got those quiries, but what about the other 21
The other 21 are those two plus what ever else you have loaded on the vBadvanced portal.
The only way to cut portal queries is to get rid of some of the content.
it's best to ask this question in the vBadvanced thread.
KW802
03-14-2005, 06:26 PM
Uncached templates: adv_portal_latesttopicbits (5)
Uncached templates: adv_portal_latesttopics (1)Check your changes to your global.php file. ;)
neocorteqz
03-14-2005, 06:58 PM
Check your changes to your global.php file. ;)
Besides that he wants to cut back the amount of queries on that page.
Now If I read that right, if he caches those two he'll save 6?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.