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)

scotty 03-26-2002 10:39 PM

anyone suggestions for my prob?
https://vborg.vbsupport.ru/showthrea...244#post230244

TECK 03-26-2002 11:06 PM

Quote:

Originally posted by scotty
anyone suggestions for my prob?
https://vborg.vbsupport.ru/showthrea...244#post230244

sessionhash probs. check your hacks.

Jawelin 03-27-2002 08:15 AM

Quote:

Originally posted by nakkid
i'm convinced is a server issue Jawelin. as you see, even in unhacked (details) mode you get negativs. i wish i could do something but i cant. you should contact your host. let me know what they said.. it might help others who have the same prob.
Yes, sure. My server is quite strange (Linux shared...). Even - thanks to your enhanced hack version - I saw they somethimes turn off the gzip for no reason ... Bah!?!?

Instead I often get a negative value on the forumhome page, with about 35 queries. Some hacks installed, but even with the original index.php and templates, the query time has often strange values.
I asked my host people, but they said it's an 'application' issue cause they use a standard MySQL configuration... :rolleyes:

Pragmatically, I would findout a simple way to re-scale strange values with a not-totally-random algorithm... :classic:
I though to 'sql time % 100', but it's too empiric.... :p
Do you have any better idea ?

Thanks and welcome back. As you can see, Nakkid, your work became very popular... :squareeyed:

Bye

lowlight 03-27-2002 11:32 AM

So what's a good stat to have?

Most of my pages are like this:

Page generated in 0.5019860 seconds (91.89% PHP - 8.11% MySQL) with 22 queries.

I guess it's good that MySQL isn't bogging down right? :)

TECK 03-27-2002 11:58 AM

looks good to me.. your stats are solid. not to many queries (very important for your server - keep it under 40)

TECK 03-27-2002 12:02 PM

Quote:

Originally posted by Jawelin
Pragmatically, I would findout a simple way to re-scale strange values with a not-totally-random algorithm... :classic:
I though to 'sql time % 100', but it's too empiric.... :p
Do you have any better idea ?

install a test board with no hacks. this way you will see exacly where is the bug related to your server.

the way your host twisted the answer made me laugh. application prob? hmmm well, with a plain board installed there is nothing thay can commnet on it. i guarantee you will get the same probs. let me know please how it went. :)

lowlight 03-27-2002 12:47 PM

Quote:

Originally posted by nakkid
looks good to me.. your stats are solid. not to many queries (very important for your server - keep it under 40)
Yeah I want to keep everything running nicely... I have PHP-Accelerator installed, and MOD_GZIP... I hope all that helps, because I am going to make my site into a full dynamically-served site!

Wish me luck :D

JDD 03-27-2002 01:20 PM

Hi...

I have examined the code a little bit deeper, and I got a solution for these negative value problems, I think.
In my opinion it is a little bug in your hack. I figured out that my pagestarttime was always set to zero.
This is caused in global.php:
PHP Code:

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


so it will only be set if showqueries is set.

I changed it to:

PHP Code:

$pagestarttime=microtime();

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


so.. with this I got a start time. But there is an other little problem in functions.php.

replace this:

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"

with
PHP Code:

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

  
$totaltime=$endtime[0]-$starttime[0]+$endtime[1]-$starttime[1];
  
$trimmedtime=number_format($totaltime,$digits);
  
$percentphp=number_format(((($totaltime-$querytime)/$totaltime)*100), 2)."% PHP";
  
$percentsql=number_format((($querytime/$totaltime)*100), 2)."% MySQL"

and now it should work perfectly, at least for me it does :)

Greets
JDD

If this may be wrong, just inform me and I edit this (but I think it should solve the problem)

TECK 03-27-2002 10:59 PM

PHP Code:

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

initially, that's what i had in my hack, but the numbers were most of the time messed.. that was the issue i debated with firefly. he did the same thing here at vB.org. i cannot explain it why but this will work only in 20% of servers. as you see, there are alot of users who dont have this problem at all.. so i decided to leave it the way it is. firefly even went deeper then you think, by contacting a develloper at vB.com just to get an answer to the mistery.

leave the rest unchanged, it should work fine, the starttime must be set to zero.

JDD 03-28-2002 06:43 AM

Quote:

initially, that's what i had in my hack, but the numbers were most of the time messed..
jepp, no wonder if starttime is allways set to zero. You would get funny looking huge values most of the time ;) (exactly the difference to 1.1.1970 :D) btw. how do you calculate times over 1 sec with not handling the seconds part of microtime at all in your totaltime?

Quote:

leave the rest unchanged, it should work fine, the starttime must be set to zero.
sorry to disagree here as well... But if starttime is set to zero you will never get correct values.. The reason why the mysql part works is easy. You don't subtract the endtime from the starttime directly but go over some interims vars (beforetime, aftertime), so the starttime part isn't invovled in the calculating at all.

So, just give my modifications a chance and try them out, you'll see they would work. I have no clue why it is working on vB.org, but I doubt they use your code in it's original form.
This is btw. a really nice hack - I like it very much therefore I tried to make it work and excamined it a little bit more than usual.

JDD


All times are GMT. The time now is 11:46 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.01647 seconds
  • Memory Usage 1,768KB
  • 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
  • (5)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
  • (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