vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   vBMicrostats (https://vborg.vbsupport.ru/showthread.php?t=116027)

Eagle Creek 01-09-2007 10:40 PM

<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...

Raptor 01-15-2007 07:24 PM

yes would like for 3.6.4 also - thanks

LunaTech 01-19-2007 05:12 PM

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;
                }
        }


COBRAws 01-23-2007 08:06 AM

any updates on this?

Thank you

Snake 01-23-2007 08:38 AM

Thanks, LunaTech. Seems to work just fine on 3.6 now. :)

sduckie2k5 01-31-2007 03:14 PM

Quote:

Originally Posted by LunaTech (Post 1162895)
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

stomph 02-01-2007 01:31 AM

Thank you!

Realm of Horror Comics 02-03-2007 10:09 AM

Great mod, thanks!! :D

TECK 02-25-2007 07:44 PM

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


All times are GMT. The time now is 06:04 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
  • Page Generation 0.01126 seconds
  • Memory Usage 1,756KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete