Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons

Reply
 
Thread Tools
vBMicrostats Details »»
vBMicrostats
Version: 1.0.5, by TECK TECK is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 3.5.4 Rating:
Released: 05-18-2006 Last Update: 05-21-2006 Installs: 92
Uses Plugins Template Edits
Code Changes  
No support by the author.

Finally, the vBMicroStats product for vBulletin 3.5.4 is here.
The previous versions of my mod were very solicited by vBulletin administrators...
I hope you will enjoy this new version as much you did the other ones.

Looking for VB 3.6.x version? It is here.

This mod with 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:
? Server memory usage per page (in Kb)
? DEBUG mode status
? Browser GZIP library compression status
? Server average loads
? Uncached templates (useful to troubleshoot the code)

The code modifications listed below were tested into a clean installed vBulletin board. They work 100%.
If you encounter any problems, feel free to post your questions here.

Step by step install instructions are posted into vbmicrostats.html file.
In order to perform an efficient modification of your files, I recommend you to use Dreamweaver (Coder Mode) or Textpad.
Both editors will allow you to complete all steps without any coding errors.

I tried to use the plugin system as much as I could, in order to avoid any unnecessary code modifications.
In order to set the right query execution time, you will need to perform 2 small code changes to each of the following files:
? class_core.php (folder /includes)
? init.php (folder /includes)

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-plugin_vbmicrostats.xml file.

Once the product installed, don't forget to enable it.
Go to your vBulletin Options, click on BB MicroStats setting group and set all your options.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #252  
Old 01-09-2007, 10:40 PM
Eagle Creek's Avatar
Eagle Creek Eagle Creek is offline
 
Join Date: Jan 2004
Location: Netherlands
Posts: 742
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<i>Find:

function query_wrapper($buffered = true, &$link)
{
return $this->functions[$buffered ? 'query' : 'query_unbuffered']($this->sql, $link);
}</i>

I can't find it at all! 6.4 huh... Signing up.. Standing in que...
Reply With Quote
  #253  
Old 01-15-2007, 07:24 PM
Raptor Raptor is offline
 
Join Date: Nov 2001
Posts: 499
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yes would like for 3.6.4 also - thanks
Reply With Quote
  #254  
Old 01-19-2007, 05:12 PM
LunaTech LunaTech is offline
 
Join Date: Aug 2004
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Till TECK gets to this, all you have to do to get this working in 3.6.4 is change what you edit in class_core.php. Instead of the instructions given, replace execute_query in class_core.php with:

Code:
	function &execute_query($buffered = true, &$link)
	{
		$this->connection_recent =& $link;
		$this->querycount++;

		// start microstats timer
		$this->mstimer_start();
		$queryresult = $this->functions[$buffered ? 'query' : 'query_unbuffered']($this->sql, $link);
		$this->mstimer_stop();

		if ($queryresult)
		{
			// unset $sql to lower memory .. this isn't an error, so it's not needed
			$this->sql = '';

			return $queryresult;
		}
		else
		{
			$this->halt();

			// unset $sql to lower memory .. error will have already been thrown
			$this->sql = '';
		}
	}

	/**
	* vBMicroStats: Query execution time
	*
	* @return	string
	*/
	var $mstime_total = 0;
	var $mstime_before = array();
	function mstimer_start()
	{
		$this->mstime_before[] = microtime();
	}
	function mstimer_stop($qtime_total = true)
	{
		$mstime_after  = microtime();
		$mspage_start  = explode(' ', TIMESTART);
		$mspage_start  = $mspage_start[0] + $mspage_start[1];
		$mstime_before = explode(' ', array_pop($this->mstime_before));
		$mstime_before = $mstime_before[0] + $mstime_before[1] - $mspage_start;
		$mstime_after  = explode(' ', $mstime_after);
		$mstime_after  = $mstime_after[0] + $mstime_after[1] - $mspage_start;
		$mstime_taken  = $mstime_after - $mstime_before;
		if ($qtime_total)
		{
			$this->mstime_total += $mstime_taken;
		}
	}
Reply With Quote
  #255  
Old 01-23-2007, 08:06 AM
COBRAws's Avatar
COBRAws COBRAws is offline
 
Join Date: Oct 2002
Location: Buenos Aires
Posts: 864
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

any updates on this?

Thank you
Reply With Quote
  #256  
Old 01-23-2007, 08:38 AM
Snake's Avatar
Snake Snake is offline
 
Join Date: Mar 2005
Location: Cleveland, OH
Posts: 3,832
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, LunaTech. Seems to work just fine on 3.6 now.
Reply With Quote
  #257  
Old 01-31-2007, 03:14 PM
sduckie2k5 sduckie2k5 is offline
 
Join Date: Oct 2005
Location: Colorado
Posts: 62
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by LunaTech View Post
Till TECK gets to this, all you have to do to get this working in 3.6.4 is change what you edit in class_core.php. Instead of the instructions given, replace execute_query in class_core.php with:

Code:
	function &execute_query($buffered = true, &$link)
	{
		$this->connection_recent =& $link;
		$this->querycount++;

		// start microstats timer
		$this->mstimer_start();
		$queryresult = $this->functions[$buffered ? 'query' : 'query_unbuffered']($this->sql, $link);
		$this->mstimer_stop();

		if ($queryresult)
		{
			// unset $sql to lower memory .. this isn't an error, so it's not needed
			$this->sql = '';

			return $queryresult;
		}
		else
		{
			$this->halt();

			// unset $sql to lower memory .. error will have already been thrown
			$this->sql = '';
		}
	}

	/**
	* vBMicroStats: Query execution time
	*
	* @return	string
	*/
	var $mstime_total = 0;
	var $mstime_before = array();
	function mstimer_start()
	{
		$this->mstime_before[] = microtime();
	}
	function mstimer_stop($qtime_total = true)
	{
		$mstime_after  = microtime();
		$mspage_start  = explode(' ', TIMESTART);
		$mspage_start  = $mspage_start[0] + $mspage_start[1];
		$mstime_before = explode(' ', array_pop($this->mstime_before));
		$mstime_before = $mstime_before[0] + $mstime_before[1] - $mspage_start;
		$mstime_after  = explode(' ', $mstime_after);
		$mstime_after  = $mstime_after[0] + $mstime_after[1] - $mspage_start;
		$mstime_taken  = $mstime_after - $mstime_before;
		if ($qtime_total)
		{
			$this->mstime_total += $mstime_taken;
		}
	}
Not sure I follow, replace all instances of execute_query with the above code? Thanx
Reply With Quote
  #258  
Old 02-01-2007, 01:31 AM
stomph stomph is offline
 
Join Date: Dec 2006
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you!
Reply With Quote
  #259  
Old 02-03-2007, 10:09 AM
Realm of Horror Comics's Avatar
Realm of Horror Comics Realm of Horror Comics is offline
 
Join Date: Aug 2005
Location: UK
Posts: 73
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great mod, thanks!!
Reply With Quote
  #260  
Old 02-25-2007, 07:44 PM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="https://vborg.vbsupport.ru/showthread.php?t=140449" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=140449</a>
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:19 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04897 seconds
  • Memory Usage 2,297KB
  • Queries Executed 24 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete