![]() |
vBMicroStats
This hack will add at the bottom of each vBulletin (powered) page, the statistics listed below.
Also, it will help you troubleshoot and optimize your vBulletin board by viewing or comparing PHP/MySQL options and other statistics that are normally hidden in your forum pages. Regular Users: ? Load time of specified page in microseconds ? Number of queries executed ? PHP percent page usage ? MySQL percent page usage Administrators Only: ? Active users browsing the forum (members and guests) new in 1.1.0 ? Server memory usage per page (in Kb) ? Display DEBUG mode status ? Browser GZIP library compression status ? Server average loads ? Uncached templates (useful to troubleshoot the code) The code modifications were tested into a clean installed vBulletin board. They work 100%. The hack was tested in vBulletin 3.6.4 and 3.6.5. If you want to test it into a lower version (3.6.x), let me know. Also, if you encounter any problems, feel free to post your questions here. Step by step install instructions are posted into readme.html file. In order to perform an efficient modification of your files, I recommend you to use Komodo Edit or Textpad. Both editors will allow you to complete all steps without any coding errors. The code changes are very safe and designed not to interfere in any way with the vBulletin performance/functionality. Make sure you modify, save and upload one file at the time to your server. Then, simply run the product-vbmicrostats.xml file. [high]The PLUGIN itself is DISABLED by default.[/high] This was done in order to make sure you properly edit your code first and to avoid surprises. You will need to enable it, once your code modifications are completed: Plugins and Products > Manage Products > vB Microstats > Enable (dropdown) Then, go to your vBulletin Options, click on BB MicroStats setting group and set all your options. Upgrade to version 1.0.2. Upgrade to version 1.0.3. Upgrade to version 1.1.0. Want to be a guinea pig and try this hack into a higher vBulletin version? :) Post your results, so others can read your feedback. |
thanks for porting it to 3.6.4 :)
|
It was about time... 285 years later, heh.
I really did not have time, sorry guys. |
Welcome back TECK. :)
|
Thanks.
Matt, do I know you (changed nick)? Since you are old school... :D |
Awesome! Thanks very much! ;)
|
Great work, installed and working fine.
Thx man |
Little boring code change, heh. Actually, the code was not elegant.
Since we are already dealing with boolean values, no need to use the deprecated iif function. Forgot to replace that from 3.5.x files. Upload the /plugin files again, no other changes are needed. |
Quote:
From your site: Page generated in 0,84680104 seconds (73,80% PHP - 26,20% MySQL) with 67 queries :eek: :eek: :eek: |
67 Queries? Wow lol... I only have roughly 24 on Forumhome and I've got as much hacks and queries running as I need.
Good job TECK, I've been waiting for you to port this to 3.6.x :D ;) |
I installed version 1.0.5 for 3.5.4 and made it work with 3.6.4 by using the code below.
Maybe a dumb question, but is there any reason I should use this version instead? It seems like there are more code changes and 2 new files. Also, before I could get this post out the version changed from 1.0 to 1.0.1; what changes were made to the /plugins files? Great mod TECK, Thank you... Quote:
|
One, the code edit in the above function is not accurate, the execution time will not be reflected properly.
Two, there are 2 execute_query() functions in VB, totally different. You DO NOT paste the same code in both places. Hmm, I think I found a bug. Guys do this, logout and tell me if you still see the admin microstats. You should only see the regular microstats, the second line should be hidden. |
Never thought I would say this, but now I wish I could turn on enable-memory-limit.
|
Guys, make me a favor, logout and tell me if you still see the admin microstats.
Thanks. |
Quote:
PHP Code:
PHP Code:
|
Thanks. So, does it show the admin stats when logged out?
The code should be: Code:
$show['adminoptions'] = (bool)($vbulletin->options['vb36_mstats_adminactive'] AND $vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']); For some servers, the data needs to be loaded directly into memory. Can you guys post and tell me if with the actual unchanged code from version 1.0.1 you see the admin stats while logged out. The fix is easy, but I need to make sure. |
In 1.0.1 yes, I do see the admin stats as guest, registered and admin user.
/installed ;) |
Perfect, thanks. :)
Fixing this bug is very easy. I also decided to load into memory all data, it should improve performance. To upgrade to version 1.0.2, all you have to do is: 1. Uninstall the vBMicrostats product but leave class_core.php and init.php code modifications in place. They are good. 2. Delete folder /plugins. 3. Download the new 1.0.2 .zip file. 4. Run the product-vbmicrostats.xml installer. 5. Enable all BB MicroStats options, like before. You are done. :) |
teck will this code mod still work from this post? https://vborg.vbsupport.ru/showpost....1&postcount=34
|
Yes. :)
Use the new conditionals, compare the code. |
ok thank you working on it now
|
Installed Thank You :)
|
Let me know how is the new version.
|
Reeve of shinra is checking my thread, as I type.
Good to see you, old school friend. :) |
seems like its working alot better then the last one. my stats use to stay the same alot on the 3.5.4 one but this one is reading the stats pretty well Page generated in 0.32 seconds (70.22% PHP - 29.78% MySQL) with 21 queries and the php and mysql change with each refresh where as the last one was reading it wrong it seemed.
|
Thanks for the feedback. That's the reason why I told to ncweb not to use the old code.
The new one is pretty elegant. :) You can see if it's working well this way: 70.22% PHP + 29.78% MySQL = 100% code ops. |
yeah the last version on 3.5.4 wouldn't do that this is much nicer and works 100% every time only thing I have left to do now is enable-memory-limit in php. thanks again.
|
I find two instances of this in File: init.php (folder /includes)
Code:
if (!empty($db->explain)) Either way I am getting some very wierd numbers (-28 php - 128% mysql); please see screenshot. It always says more mysql than php, shouldn't that be the other way around? Thanks... |
Quote:
how can you find that one when it says to search for this.. Code:
if ($vbulletin->session->vars['styleid'] != 0) |
Quote:
|
Mr. F, welcome back.
|
Quote:
Quote:
Will update the readme file. About the negative values, is all related to server time clock, microtime(). It's a confirmed bug. Freddie (vB dev) managed to reproduce the bug but did not released a fix. Since I use the vB core functions, this error is reflected into your time, if you are not lucky. Read more here: http://www.vbulletin.com/forum/bugs3...iew&bugid=2481 |
Thinking out loud, what PHP version you have? I have 5.2.1, working perfectly here:
http://67.68.90.79/forum/ |
Quote:
The stats are awesome, this has always been one of my favorite mods. Things are working like a charm but I forgot that I had an older version (1.0.5) installed. I didn't choose to over write and I have two options in the admincp for the mod. No biggie, I disabled it for now and will probably uninstall later when I do a backup. Just thought I'd point that out if anyone else runs across it. |
Quote:
Looks like the bug referenced at http://www.vbulletin.com/forum/bugs3...iew&bugid=2481 never got fixed in 3.6.x. Quote:
I'm running PHP 4.4.4; I saw on http://67.68.90.79/forum/ that the mysql % was higher than that of php. If that basically a default install then I guess that?s normal. Thanks for your time and the replies TECK |
Quote:
Those times reflect the percentage. You will also see there negative results, so that should answer your questions related to the vB bug. Let's take an example shall we? http://67.68.90.79/forum/showthread.php?t=1 Page generated in 0.13296827 seconds (61.87% PHP - 38.13% MySQL) with 9 queries And the Explain: Page generated in 0.13317393951416 seconds with 9 queries, spending 0.011376857757568 doing MySQL queries and 0.12249708175659 doing PHP things. Glad I could help. :) Quote:
I remember when people used to queue on your board for your hacks... good times. :) If you feel like talking on MSN, drop me a PM, I'll send you the ID. |
Thanks for updating this m8
|
Thanks for updating this after my request Floren :)
It is also nice to see you back alive at vb.org |
Nice. Thanks. :)
|
Quote:
|
All times are GMT. The time now is 07:14 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|