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)

Erwin 07-21-2002 07:49 PM

Oh yeah, I disabled forum access masks as well, and made the "Who's Online" page only for admins to prevent the private forum bug.

KuraFire 07-22-2002 10:34 AM

I haven't been keeping up with this thread for a while, but I noticed a 'flaw' in this hack that is rather scary...

When I installed it (just after the 226 db_mysql.php came out) it didn't add the $query_count var. to the query_first function. The Query_first function is, however, as the name implies, another function using queries, and all these queries were omitted since there was no global $query_count and $query_count++; part palced in it. If you do, you'll suddenly notice how much queries are added. On my board, the count went up with an average of 15 queries. Those are all queries with limit 1 (the query_first function) but still queries. I don't think that's a very good thing....

I'm probably missing out on some info here, but to me, that seems bad. Showthread pages now have a standard of 46 queries on average, with a few 1-query hacks installed.... :/

KuraFire 07-22-2002 03:43 PM

btw...

Is it me, or is it rather silly that Invisibility (I assume this is the normal feature that says whether a user is displayed as logged in or invisible (guest) ?) is something that doesn't require an independant query at all?

I really don't see why that feature requires its own query to be enabled. Someone please explain?

TECK 07-22-2002 04:27 PM

Quote:

Originally posted by KuraFire
I haven't been keeping up with this thread for a while, but I noticed a 'flaw' in this hack that is rather scary...

When I installed it (just after the 226 db_mysql.php came out) it didn't add the $query_count var. to the query_first function. The Query_first function is, however, as the name implies, another function using queries, and all these queries were omitted since there was no global $query_count and $query_count++; part palced in it. If you do, you'll suddenly notice how much queries are added. On my board, the count went up with an average of 15 queries. Those are all queries with limit 1 (the query_first function) but still queries. I don't think that's a very good thing....

I'm probably missing out on some info here, but to me, that seems bad. Showthread pages now have a standard of 46 queries on average, with a few 1-query hacks installed.... :/

this hack doesnt add any query, it only give you the opportunity to see what it's happening behing php and mysql, on every page. it's doing this by only using the microtime function built in php. the rest of functions are used as default by vbulletin.

here it is an example of the original db_mysql.php:
Code:

  function query($query_string) {
    global $query_count,$showqueries,$explain,$querytime;
    // do query

as you notice, $query_count is present there, in the original file. the only mods i did is to allow to insert the microtime at the beginning and end of page so i can see exacly the time it took to generate the page.
i recommend you to download the latest vb226 package from members area and look at the db_mysql.php file. then to modify it properly. there have been several versions of this file and my hack includes instructions with the latest downloadable .zip file from members area.
also, i dont see where you added query_first string, because is not required in my hack.

at no time you will see 15queries added. this is related to other hacks you added, not vbMicroStats.

KuraFire 07-22-2002 06:40 PM

Nakkid, was my post that unclear to you???

I Never said that it was this hack that added queries. Nowhere. I was talking about the QUERY_FIRST function of vBulletin itself that adds queries, but with this hack all those queries were omitted from the variable $query_count, therefore the number displayed at the bottom in the microstats - this hack allowing for that to be seen - is actually quite a lot higher (15 queries higher on average) than you get with the default install of this hack (last I checked the install instructions, that is).

There are TWO functions in vBulletin to do a query, and your hack counted only the queries done by ONE of them, therefore at the bottom where it says "with XX queries" the number was wrong, by a shocking 15 on average, which are all the queries done by vBulletin's QUERY_FIRST function.

Are you getting this, now? :/

Admin 07-22-2002 07:15 PM

Quote:

Originally posted by KuraFire
Nakkid, was my post that unclear to you???

I Never said that it was this hack that added queries. Nowhere. I was talking about the QUERY_FIRST function of vBulletin itself that adds queries, but with this hack all those queries were omitted from the variable $query_count, therefore the number displayed at the bottom in the microstats - this hack allowing for that to be seen - is actually quite a lot higher (15 queries higher on average) than you get with the default install of this hack (last I checked the install instructions, that is).

There are TWO functions in vBulletin to do a query, and your hack counted only the queries done by ONE of them, therefore at the bottom where it says "with XX queries" the number was wrong, by a shocking 15 on average, which are all the queries done by vBulletin's QUERY_FIRST function.

You are the one that is confused.

If you had taken the time to actually look at the query_first() method you would see that it calls query() itself. What you did was count all the query_first() queries twice.

Look:
Code:

  function query_first($query_string) {
    // does a query and returns first row
[high]    $query_id = $this->query($query_string);[/high]
    $returnarray=$this->fetch_array($query_id, $query_string);
    $this->free_result($query_id);
    return $returnarray;
  }


KuraFire 07-22-2002 08:09 PM

I wasn't confused, I was just uncertain that what I thought was actually how vB worked, which, thankfully, isn't the case.

Nakkid totally didn't get my post up there, but that may well be cos he already knew about that. (notice how I asked for clarity on this thing in my first post on this page? :))

thx btw for that :up:

Boofo 07-22-2002 08:37 PM

What private forum bug? :)

Quote:

Originally posted by Erwin
Oh yeah, I disabled forum access masks as well, and made the "Who's Online" page only for admins to prevent the private forum bug.

Erwin 07-23-2002 02:21 AM

Quote:

Originally posted by Boofo
What private forum bug? :)


It's discussed in vbulletin.com

Basically if you switch off forum access mask, members can look at the titles of threads in a private forum if a staff member is reading the thread by lookin at the Who's Online page. (At least on my site and a few others).

jassim 07-23-2002 07:02 AM

ok i want last vr for this hacks :)

thankx


All times are GMT. The time now is 06: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.01833 seconds
  • Memory Usage 1,752KB
  • 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
  • (4)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