vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   vbMicroStats: page load time, queries, GZIP and PHP version (https://vborg.vbsupport.ru/showthread.php?t=35811)

TECK 03-29-2002 01:16 AM

i modified a little the [high]$pagestarttime[/high] code JDD posted initially.
let's hope that will cure all the probs...... ;)

Kyomu 03-29-2002 02:47 AM

Quote:

Originally posted by nakkid
This upgrade will fix the negative values some users get when loading a page.

CREDITS:
JDD
pagestarttime addon in [high]global.php[/high]

forum/global.php (2 changes)
1. Find the code:
PHP Code:

if (isset($showqueries)) {
  
$pagestarttime=microtime();


Replace it with:
PHP Code:

if (isset($showqueries)) {
  
$pagestarttime=microtime();
} else {
  
$pagestarttime=microtime();



Can't that just be replaced with
PHP Code:

$pagestarttime=microtime(); 

Either case of the if statement will yield that code... so there really is no need for the if statement. Right?

TECK 03-29-2002 02:50 AM

$showqueries is present and it asks for microtime.. the rest is for my hack.. :)
i did it this way so you dont get any wierd errors if u miss [high]isset[/high]. i like to leave VB unchanged in those areas.. you never know where it can hit you with an error. leave it this way, it will not hurt nothing.

FWC 03-29-2002 06:01 AM

Quote:

Originally posted by nakkid
This upgrade will fix the negative values some users get when loading a page.
That did the trick! Thank you. :classic:

Admin 03-29-2002 06:33 AM

Quote:

Originally posted by nakkid
$showqueries is present and it asks for microtime.. the rest is for my hack.. :)
i did it this way so you dont get any wierd errors if u miss [high]isset[/high]. i like to leave VB unchanged in those areas.. you never know where it can hit you with an error. leave it this way, it will not hurt nothing.

He's right though, it really doesn't matter. It's like:
Code:

if ($me == $you) {
  echo 'yea';
} else {
  echo 'yea';
}

No matter what it will echo yea, so you better just remove the if statement.

Renegade 03-29-2002 09:39 AM

Very cool hack, especially when debugging the board.

TECK 03-29-2002 01:33 PM

Quote:

Originally posted by FireFly
He's right though, it really doesn't matter.
done, removed the code. wasnt sure if it would not affect anything.. ;)

TECK 03-30-2002 02:40 AM

in other order of ideas... can you post if there are still any negative values present at all time?
thanks.

Jawelin 03-30-2002 07:51 AM

Quote:

Originally posted by nakkid
in other order of ideas... can you post if there are still any negative values present at all time?
thanks.

Nakkid, here I'm.
Since installed 1.7 I never got negative values any more, even on the forumhome... :knockedout:

Still I'm receiveing strange values for time. As JDD said before perhaps due to global.php reloaded many times (so even the pagestarttime many times reset), I always get too small values for microseconds elapsed. :(

I made this check:
  • created a function getmicrotime() to expand seconds and microseconds, as sampled on php.net
  • put a $customstartpage=getmicrotime() at the top of a php page
  • put a $customstoptime = getmicrotime() at the end of an action
  • displayed the difference near the { getmicrostats } replacement variable
  • ...
Well. $customdifference values are MUCH larger than the {gms} variable one !!! (about an order... i.e. 10 vs. 1 !!! )

How could I force the pagestarttime reset only at the very beginning of the page and not other times within ????

Thanks again for all your upgrades and support .
Bye

TECK 03-30-2002 11:12 AM

hmm.. did you tried the simple plain microtime? instead of exploding it like at php.net?


All times are GMT. The time now is 08:07 AM.

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.01529 seconds
  • Memory Usage 1,746KB
  • 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
  • (1)bbcode_code_printable
  • (3)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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