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)

Flash69 03-23-2003 05:49 AM

Triple post, server was not responding.

dethfire 03-24-2003 03:06 AM

my serverload doesn't show up, any ideas?

TECK 03-24-2003 02:38 PM

Your server doesn't support the exec( 'uptime' ) function.
Contact your host.

94supratt 03-26-2003 12:57 AM

I installed this on 2.3.0 and got this....

Quote:

Page generated in 1,048,647,125.57871699 seconds (100.00% PHP - 0.00% MySQL) with 27 queries.
Thats it? I don't think page generated is correct.

Wolf42 03-31-2003 06:46 AM

TECK, thank you for the fix for vB 2.3.0. Couse I had to uninstall after upgrade. But now its working again! :D

feldon23 03-31-2003 05:49 PM

The dovars replacement does not even remotely match what's in my vB2.3.0. :(

ManagerJosh 04-01-2003 04:41 AM

Something isn't right TECK with this code:

PHP Code:

function dooutput($vartext,$sendheader=1) {

  global 
$pagestarttime,$query_count,$showqueries,$querytime,$DB_site,$gzipoutput,$gziplevel,$bbuserinfo,$microstats;

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

  
// time format
  
$digits 8;
  
$totaltime $endtime[0] - $starttime[0] + $endtime[1] - $starttime[1];
  
$trimmedtime number_format$totaltime $digits );
  
$percentphp number_format( ( ( ( $totaltime $querytime ) / $totaltime ) * 100 ) , ) . '% PHP';
  
$percentsql number_format( ( ( $querytime $totaltime ) * 100 ) , ) . '% MySQL';

  if ( 
$bbuserinfo['usergroupid'] == )
  {
    
$adminstats '';
    
$serverload '';
    
$versionnum phpversion();
    
$debugmode 'Debug Mode OFF';
    
$gziptext 'GZIP disabled';
    if ( 
$debug == )
    {
      
$debugmode 'Debug Mode <font color="{ hovercolor}">ON</font>';
    }
    if ( 
$gzipoutput == )
    {
      
$gziptext 'GZIP <font color="{ hovercolor}">enabled</font> - level ' $gziplevel;
    }
    if ( 
$stats = @exec'uptime' ) )
    {
      
preg_match'/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/' $stats $regs );
      
$serverload ' [Server Load: <font color="{ hovercolor}"><b>' $regs[1] . '</b></font> ? ' $regs[2] . ' : ' $regs[3] . ']';
    }
    
$adminstats '<br />[' $debugmode '] [PHP v' $versionnum '] [' $gziptext ']' $serverload;
  }

  if (
$showqueries) {
    
$vartext .= "<!-- Page generated in $totaltime seconds with $query_count queries -->";
  } else {
    eval( 
'$microstats = "' gettemplate'microstats' ) . '";' );
  } 

I followed all the directions for the 2.3.0 version but when I upload, I get a blank page.

USODJA 04-01-2003 10:15 AM

Read the instructions again, I had the same problem, traced it to the functions.php, took a clean version slowly redid it then it worked, if those } are not in the exact place, then it crashes, also remove the space before all the hoover comments...

Erwin 04-01-2003 10:28 AM

The dovars bit in the Final Release of 2.3.0 is different to the fix TECK posted. You can work around it, but I'm sure TECK will post an updated fix for the Final Release soon. :) I managed to get mine working by slowly comparing the codes in any case...

SgtSling 04-01-2003 11:41 AM

the reason why it won't work with the version 3.0 is because it calls the wrong template
recheck the instructions

Erwin 04-01-2003 11:48 AM

No, it's because the code is different - there is an extra bit to check for PHP version etc. that is not in the RC versions.

blippio 04-03-2003 12:28 AM

Ok. I have installed and uninstalled and re-installed this hack several times. I have read the latest posts about the "dovars" code and I can see that they are different (I am running 2.3 rc2).

My question is this: why do I get the 12323423.43345345 seconds error on my vBHome, but not on my forums page? Also, when installing this hack for the last time, I was refreshing this vbHome page and I suddenly got it work (no "seconds" error), but when I went to the forums, and came back to the vbHome page, the 123123123123.23123124554 seconds error returned.

Is this some clue as to a specific issue with my install?! I know a lot of people are having an issue of getting this to work at all, but mine works fine on the forums, and with erroneous results on my vBHome.

Any ideas?

ManagerJosh 04-03-2003 04:14 AM

I'm having issues with it myself. I reviewed everything carefully but still running into problems.

My problem is that when I replace what nakkid asked me to replace in the dooutput, I get a blank white page when viewing the forumhome.

Something is very wrong... *frowns*

Ralf vd Enden 04-04-2003 01:33 PM

I have the same problem as blippio. On the forum page everything works fine, but when I add {getmicrostats} to the footer of the VBHL template the seconds and percentage show weird values.

Is there a fix?

Sebastian 04-05-2003 08:25 PM

Hey Teck,

There is a little mistake in the .txt file you made for 2.3.0.

i guess you changed the eval template to "microstats" instead of "home_microstats"

but at the end of the file you say to make template "home_microstats"

and the eval() is just "microstats"

I was like "Why the hell won't it show?!" until i figured out it was looking for template "microstats" and the template was called "home_microstats" ;) :p

deepdark 04-07-2003 04:50 PM

i installed every thing but i dont know why is not working :(

leitel 04-07-2003 05:06 PM

Me neither. I guess I'll have to wait until SOMEONE can verify their install on 2.3.

Ralf vd Enden 04-07-2003 05:17 PM

I have VB 2.3.0, VBHL 4.2 and vbMicroStats installed and it works great. The only thing I can't get to work is adding the microstats on the VBHL homepage (in the footer). It shows 100% PHP and a huge figure for the seconds it needed to generate the page.

So if you want verification of all this working on a 2.3.0 installation.... I think I'm the living proof. There's prolly lots more people out there that got it to work.

Entourage 04-09-2003 08:38 AM

I'm installed it on my vbulletin 2.3.0, also applied the fix voor function.php, I dont get any error now, so that good ;) but when I go to my form, I see this:

:number of digits for microtime
:the time your page is loaded
6 :number of queries executed
:tells if VB is in debug mode
:PHP version
:PHP percent page usage
:MySQL percent page usage
:GZIP compression library
1 :GZIP compression level
:your average server load

as you can see some things are working (well 2 :)) how do I fix the other things to work?

iwearnosox 04-09-2003 10:10 AM

I just installed it on 2.3. I got errors from cutting and pasting functions.php, but once I uploaded a clean version and tried again it worked.

All parts are functioning:

Page generated in 0.09815001 seconds (58.26% PHP - 41.74% MySQL) with 26 queries.
[Debug Mode OFF] [PHP v4.2.3] [GZIP disabled] [Server Load: 0.53 » 0.47 : 0.41]

Entourage 04-09-2003 11:23 AM

K, I took a clean verion of functions, gobal and db_mysql and re-edit it with the txt doc of TECK (https://vborg.vbsupport.ru/attachmen...&postid=359609) and everything is working great now! (ps. I only had to rename a template)


generated in 0.09475398 seconds (77.18% PHP - 22.82% MySQL) with 16 queries.
[Debug Mode OFF] [PHP v4.3.1] [GZIP disabled] [Server Load: 0.09 ? 0.05 : 0.01]

sabret00the 04-09-2003 02:06 PM

Quote:

04-01-03 at 01:28 PM Erwin said this in Post #769
The dovars bit in the Final Release of 2.3.0 is different to the fix TECK posted. You can work around it, but I'm sure TECK will post an updated fix for the Final Release soon. :) I managed to get mine working by slowly comparing the codes in any case...
will you do it since teck aint?

Mr. X 04-09-2003 06:34 PM

Just wondering, and sorry if its been posted already, but can and how can I move the [Debug Mode OFF] [PHP v4xxx] [GZIP disabled] [Server Load: xxx» xxx: xxx] line so that it is after the Page Generated line? Im using the PHP based code, not the template to have it appear in my footer. It appears fine for users, but for admins we see the 2nd line, and for some reason its adding an ugly space to my footer. Is there anyway to just move that line up after the Page Generated line, so it'll be just one sentence?

TECK 04-09-2003 09:22 PM

Quote:

Today at 01:23 PM Entourage said this in Post #781
K, I took a clean verion of functions, gobal and db_mysql and re-edit it with the txt doc of TECK (https://vborg.vbsupport.ru/attachmen...&postid=359609) and everything is working great now! (ps. I only had to rename a template)


generated in 0.09475398 seconds (77.18% PHP - 22.82% MySQL) with 16 queries.
[Debug Mode OFF] [PHP v4.3.1] [GZIP disabled] [Server Load: 0.09 ? 0.05 : 0.01]

If you clear your browser temp files, you don't even have to rename that template... the typo was corrected my myself about 285 years ago... ;)

Oblivion Knight 04-09-2003 10:57 PM

Page generated in 0.14942503 seconds (61.14% PHP - 38.86% MySQL) with 22 queries.
[Debug Mode OFF] [PHP v4.1.1] [GZIP disabled]


Everything appears to be working..
I'll contact my host about the server load part of the hack tomorrow.

Thankyou TECK :)
[high]* Oblivion Knight clicks install.[/high]

GoTTi 04-11-2003 09:14 PM

PHP Code:

Page generated in 1,050,098,789.69630003 seconds (100.00PHP 0.00MySQLwith 30 queries.
[
Debug Mode OFF] [PHP v4.2.1] [GZIP disabled] [Server Load0.36 0.62 0.79

how is it that 0% is mySQL? isnt that impossible?

Stadler 04-11-2003 09:25 PM

> Page generated in 1,050,098,789.69630003 seconds

I think, something went wrong there. Mybe you should recheck all the changes.

Sebastian 04-11-2003 10:30 PM

Quote:

Today at 06:08 PM Da_GoTTi said this in Post #786
PHP Code:

Page generated in 1,050,098,789.69630003 seconds (100.00PHP 0.00MySQLwith 30 queries.
[
Debug Mode OFF] [PHP v4.2.1] [GZIP disabled] [Server Load0.36 0.62 0.79

how is it that 0% is mySQL? isnt that impossible?


cool, 100% PHP , its like vitamin C, mysql is not very healthy :p

.. not sure though... check you properly hacked the files.

TECK 04-13-2003 08:12 PM

Quote:

04-11-03 at 11:08 PM Da_GoTTi said this in Post #786
PHP Code:

Page generated in 1,050,098,789.69630003 seconds (100.00PHP 0.00MySQLwith 30 queries.
[
Debug Mode OFF] [PHP v4.2.1] [GZIP disabled] [Server Load0.36 0.62 0.79

how is it that 0% is mySQL? isnt that impossible?

Search the thread for an answer.

trafix 04-16-2003 01:01 AM

I have modified everything successfully except the last stage of the anmin/functions there is a major difference in the text that should be there and what is currently there. all i can presume is that either i have a hack that also modifies that area but i cant recognoise it.
this is what should be there
PHP Code:

// ###################### Start dovars #######################
function dovars($newtext,$sendheader=1) {
  
// parses replacement vars

  
global $DB_site,$replacementsetid,$gzipoutput,$gziplevel,$newpmmsg;
  static 
$vars;

  if (
connection_status()) {
    exit;
  }

  if (!isset(
$vars)) {
    
$vars=$DB_site->query("SELECT findword,replaceword FROM replacement WHERE replacementsetid IN(-1,'$replacementsetid') ORDER BY replacementsetid DESC,replacementid DESC");
  } else {
    
$DB_site->data_seek(0,$vars);
  }

  while (
$var=$DB_site->fetch_array($vars)) {
    if (
$var['findword']!="") {
      
$newtext=str_replace($var['findword'],$var['replaceword'],$newtext);
    }
  } 

This is what is currently in my functions.php

PHP Code:

// ###################### Start dovars #######################
function dovars($newtext$sendheader 1)
{
    
// parses replacement vars

  
global $DB_site,$replacementsetid,$gzipoutput,$gziplevel,$newpmmsg,$fullpm,$bbuserinfo,$microstats;
    static 
$vars;

    if (
connection_status())
    {
        exit;
    }

    if (!
is_array($vars))
    {
        
// build an array of $vars containing find/replace values
        
$vars = array();
        
$replacements $DB_site->query("
            SELECT findword, replaceword, replacementsetid
            FROM replacement
            WHERE replacementsetid IN(-1, '" 
intval($replacementsetid) . "')
            ORDER BY replacementsetid, replacementid DESC
        "
);
        while (
$replacement $DB_site->fetch_array($replacements))
        {
            if (
$replacement['findword'] != '')
            {
                
$vars["$replacement[findword]"] = $replacement['replaceword'];
            }
        }
        unset(
$replacement);
        
$DB_site->free_result($replacements);
    }

    if (
PHPVERSION '4.0.5' or 1)
    {
        
// do each replacement in turn for PHP < 4.0.5
        
reset($vars);
        while(list(
$find$replace) = each($vars))
        {
            
$newtext str_replace($find$replace$newtext);
        }
    }
    else
    {
        
// do all replacements in one go (PHP >= 4.0.5 only)
        
$newtext str_replace(array_keys($vars), $vars$newtext);
    }

    if (
$newpmmsg)
    {
        if (
substr($PHP_SELF,-strlen('private.php')) == 'private.php')
        {
            
// do nothing
        
}
        else
        {
            
$newtext preg_replace("/<body/i""<body onload=\"Javascript:confirm_newpm()\""$newtext);
        }
    }

    if (
$gzipoutput and !headers_sent())
    {
        
$newtext gzipoutput($newtext$gziplevel);
    }

    if (
$sendheader)
    {
        @
header("Content-Length: " strlen($newtext));
    }

    return 
$newtext;
}

// ###################### Start standarderror( ####################### 

Can anyone help ???

LangTuDaTinh 04-16-2003 02:30 AM

trafix,, use the old version.(da one from page 1)..it's working.. i tried the new version....i doesn't work...

neocorteqz 04-16-2003 03:22 AM

Again, I'm using the original install of this hack with no problems, i had the same problem with it showing a 100% PHP.. I believe I was told to rehack db_mysql.php... or something like that.:p

neocorteqz 04-16-2003 05:55 PM

btw, is this good??

Page generated in 0.29245400 seconds (86.12% PHP - 13.88% MySQL) with 30 queries

thats using the updated version of MySQL(v4.0.12) and php(v4.3.1)

or are the queries still too high? and I'm starting to notice that in thread view there are no more than 30 queries tops...

Oblivion Knight 04-16-2003 06:15 PM

Quote:

Today at 06:55 PM User_001 said this in Post #793
btw, is this good??

Page generated in 0.29245400 seconds (86.12% PHP - 13.88% MySQL) with 30 queries

thats using the updated version of MySQL(v4.0.12) and php(v4.3.1)

or are the queries still too high? and I'm starting to notice that in thread view there are no more than 30 queries tops...

Yes that's good :)
As long as you're below 40 queries on any page, then your database isn't under too much load.

86.12% PHP is also pretty damn good, mine's only about 64%..

Alien 04-19-2003 12:57 AM

Works great in my 2.3.0 I'm working on..

Excellent hack, thanks a bunch! :D

ap0c 04-20-2003 03:37 AM

installed on 2.30 and working fine, I guess. I don't like the amount of queries...76,lol

Mr. X 04-20-2003 06:44 AM

Quote:

04-09-03 at 01:34 PM Mr. X said this in Post #783
Just wondering, and sorry if its been posted already, but can and how can I move the [Debug Mode OFF] [PHP v4xxx] [GZIP disabled] [Server Load: xxx? xxx: xxx] line so that it is after the Page Generated line? Im using the PHP based code, not the template to have it appear in my footer. It appears fine for users, but for admins we see the 2nd line, and for some reason its adding an ugly space to my footer. Is there anyway to just move that line up after the Page Generated line, so it'll be just one sentence?
nvm I got it..

TECK 04-21-2003 02:49 AM

Quote:

Yesterday at 04:37 AM ap0c said this in Post #796
installed on 2.30 and working fine, I guess. I don't like the amount of queries...76,lol
76 queries??? This is huge, I hope you own the server because if it's a busy site, it will crash it.

cinq 04-21-2003 03:08 AM

Cool stuff , added this without a hitch , was just trying to find out the no. of queries mine was dishing out.

But need some explanation on this :

Page generated in 0.20807695 seconds (30.47% PHP - 69.53% MySQL) with 23 queries.
[Server Load: 0.62 » 0.66 : 0.74]

What does the 30.47% PHP - 69.53% MySQL mean ?
Is 23 queries alright ? Anyway to cut it down ?
And server load bit , what does it mean ?

Sorry if this is out of the topic but didnt know where else to ask.
Thanks

Sanjiyan 04-21-2003 05:38 AM

Using the 2.3.0 version, and installed on 2.3.0 fine, apart from I get this:

Page generated in 1,050,903,363.6694 seconds (100.00% PHP - 0.00% MySQL) with 24 queries.
[Debug Mode OFF] [PHP v4.3.1] [GZIP enabled - level 2]

How do I change the Page generated in x.xxxxxxxx down to 1.234 seconds

And

It seems I have 100% PHP Load and 0% MySQL ??

Its running on a Windows XP Box atm.


All times are GMT. The time now is 01:39 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.02172 seconds
  • Memory Usage 1,897KB
  • 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
  • (6)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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