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)

Floris 03-09-2002 07:40 PM

Quote:

Originally posted by FireFly

LOL now I remember why we don't use vbPortal.

:) haha, but your's not free :P
I'll personally wait till v3 I think :>

Tim Wheatley 03-09-2002 07:56 PM

Quote:

Originally posted by nakkid
yes you do. this is extremly high. after 50 queries, the server start to go on the red side. i'm surprised your host didnt contact you yet. ;)
My host has contacted me, apologised and upgraded the server twice thinking their hardware wasn't strong enough - LOL

So - how do I find out what the problems are? I know how to edit, I understand how php works (i think) but don't know how to change how it works myself...

TECK 03-09-2002 10:25 PM

version 1.3 released. bugs fixed with vbPortal.

TECK 03-09-2002 10:27 PM

Quote:

Originally posted by Tim Wheatley
My host has contacted me, apologised and upgraded the server twice thinking their hardware wasn't strong enough - LOL

So - how do I find out what the problems are? I know how to edit, I understand how php works (i think) but don't know how to change how it works myself...

you should open a separate thread for this.

Jawelin 03-09-2002 10:58 PM

Quote:

Originally posted by Jawelin
:(
I always get PHP percentage negative.... ????
(even reloading and reloading).

Always something like :


I DON'T have VbPortal and use vb 2.2.2 yet...
Thanks

As said above, I always get negative php percent values.
So I started investigating... ;)

Could someone explain which is the meaning of
PHP Code:

  $starttime=explode(" ",$pagestarttime);
  
$endtime=explode(" ",$pageendtime);

  
$totaltime=$endtime[0]-$starttime[1];

 ... 
instead ....
  
$totaltime=$endtime[0]-$starttime[0]+$endtime[1]-$starttime[1]; 

??

Besides, actually I would prefer the first version of the hack, with an explicitly called variable to display microstats, instead of using the dooutput() function.
Mainly because I would control exactly where stats are displayed - would prefer footer only, not at the end of each page

Thanks a lot.
Bye

TECK 03-09-2002 11:01 PM

it gets the start time and end time to a specific location only.
did you try it to leave the value defaulted?
PHP Code:

$totaltime=$endtime[0]-$starttime[0]+$endtime[1]-$starttime[1]; 

when i leave it default, it gives a format like:
1,236,324,262.324626726 seconds
the negative time is due to some code misconfiguration only.

and btw, that's what ver 1.3 does (is template based) hihi...

Jawelin 03-10-2002 08:32 AM

Quote:

Originally posted by nakkid
it gets the start time and end time to a specific location only.
did you try it to leave the value defaulted?
PHP Code:

$totaltime=$endtime[0]-$starttime[0]+$endtime[1]-$starttime[1]; 

when i leave it default, it gives a format like:
1,236,324,262.324626726 seconds
the negative time is due to some code misconfiguration only.

and btw, that's what ver 1.3 does (is template based) hihi...

Nice! Now I appreciate much more the new 'philosophy' ...
:)
Same, I saw now you use
PHP Code:

$totaltime=$endtime[0]-$starttime[0]; 

(only 0 index value...)

Well. Even still doesn't work to me: the problem is - trying both versions with or without templates (wich I would prefer ...) - I have some difficulties modifying the dovars() function.
(already hacked with FF's Reader's name inside post which already puts a first-element replacement..)
Actually I wouldn't like to use another replacement handly-added and simply would use $microstats var directly in the footer template.
But it isn't enough to define it (as global) within the dooutput() function, as you did as a part of the hack.

Why ?
Any workaround ?

Excuse me, but would manage to understand the chinese-box inheritance of those php vars !!

Thanks a lot.
;)

TECK 03-10-2002 09:23 AM

you can add more then one index and value to your array:
PHP Code:

$findwords=array(=> '{getmicrostats}'=> '{bbusername}');
$replacewords=array(=> $microstats=> $bbusername);
$i=2

try it and let me know.

also dont forget that dooutput() is needed to call the headers and the time before it starts the page and it ends also. dovars() will only replace the variables. use this code for now:
PHP Code:

  // time format (how many digits you want to show)
  
$digits=7;

  
$totaltime=$endtime[0]-$starttime[0];
  
$trimmedtime=number_format($totaltime,$digits);
  
$percentphp=number_format(((($totaltime-$querytime)/$totaltime)*100), 2)."% PHP";
  
$percentsql=number_format((($querytime/$totaltime)*100), 2)."% MySQL";
  
$debugmode=(DEBUG)?" (Debug mode)":"";
  
$versionphp=phpversion();

  if (
strstr($HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"], "gzip")) {
    
$gziptext="enabled";
  } else {
    
$gziptext="disabled";
  }

  
$vartext .= "Page generated in $trimmedtime seconds ($percentphp - $percentsql) with $query_count queries.<br>
               PHP version 
$versionphp$debugmode with GZIP library compression $gziptext."

no need to edit anymore dovars(). you can add html code to it.

Jawelin 03-10-2002 10:24 AM

Quote:

Originally posted by nakkid
you can add more then one index and value to your array:
PHP Code:

$findwords=array(=> '{getmicrostats}'=> '{bbusername}');
$replacewords=array(=> $microstats=> $bbusername); 

try it and let me know.

also dont forget that dooutput() is needed to call the headers and the time before it starts the page and it ends also. [...]

Thanks for the update to dovars()....
But, as said, I would prefer to use a simple $varbit to add to the footer template.
This because I could control better the place where that var is put (if I'd used the dooutput() with $vartext, that string would be added to EACH page, even those without footer code ... i.e. vb popup smilies, etc...)
Any case I'll use by now the replacement... :(

Thanks again
Bye

TECK 03-10-2002 10:34 AM

you cannot add a variable $varbit in dooutput() for the simple reason that you will have to edit every single dooutput() piece of code in every single script that uses that function. trust me, there are alot of them. this hack is about getting the right time before and after the page is loaded. the rest of variables are pulled from the server.

i do not understand why you cannot use the array values instead? like the way i show you above? you will be able to use both strings, whereever you want to place them.


All times are GMT. The time now is 01:42 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.01659 seconds
  • Memory Usage 1,771KB
  • 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
  • (7)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)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