vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   psiStats 2006 (The New vBStats for vBulletin 3.5.x - 3.8.x) (https://vborg.vbsupport.ru/showthread.php?t=104213)

akanevsky 01-14-2006 12:24 PM

@MPDev Yorixz, Thank you :)

@MPDev:
The changes you introduced are not correct. Please look at the following two lines:

$deletions[] = "(`cdata` = '$ident[1]' AND `count` = '$data[0]' AND `ctype` = '$ident[0]' AND `cmisc` = '$data[2]')";
$insertions[] = "('$ident[1]', '" . ($data[0] + $data[1]) . "', '$ident[0]', '$data[2]')";

$data[0]+$data[1] is where the old count is added to the new count.

akanevsky 01-14-2006 03:55 PM

Quote:

Originally Posted by gothicuser
I was referring to your response! I used to drive coaches professionally for almost 35 years and if I spent my time throwing my toys out the pram at some of the stupid/silly/annoying comments from my passengers I would have been driving an empty coach all that time.
Relax, take it all with a pinch of salt. Of course you are going to get frustrating little tic-turds pestering you all the time, but thats life! Learn to live with it without embarrassing yourself.

And I was referring to you pointing a finger at yourself :)
I'm sorry, son, but you are not in a position to preach anything to anyone around here.
You have been added to my ignore list.

gothicuser 01-14-2006 03:59 PM

Never mind, you carry on the way you do, the rest of the world will carry on ignoring you!

MPDev 01-14-2006 04:05 PM

Quote:

Originally Posted by Psionic Vision
@MPDev:
The changes you introduced are not correct. Please look at the following two lines:

$deletions[] = "(`cdata` = '$ident[1]' AND `count` = '$data[0]' AND `ctype` = '$ident[0]' AND `cmisc` = '$data[2]')";
$insertions[] = "('$ident[1]', '" . ($data[0] + $data[1]) . "', '$ident[0]', '$data[2]')";

$data[0]+$data[1] is where the old count is added to the new count.

I believe you are incorrect - the reason is, as I pointed out for example, there are multiple US lines being printed; so for every US line, it overwrites the "old" value with a "new" value without taking into consideration that the results need to be cumulative during processing. In other words $data[1] needs to be a sum of all the results returned and not just the last result processed.

After alot of testing on my very busy site, I believe they are correct.

akanevsky 01-14-2006 04:14 PM

Quote:

I believe you are incorrect - the reason is, as I pointed out for example, there are multiple US lines being printed; so for every US line, it overwrites the "old" value with a "new" value without taking into consideration that the results need to be cumulative during processing. In other words $data[1] needs to be a sum of all the results returned and not just the last result processed.
Hmm... Yes. I see what you mean now. :)
However, the initial query is supposed to group the results and there should be only one single row per value... And there should not be more than one row per value in cache anyway. Let me check it...

akanevsky 01-14-2006 04:45 PM

Yup, the query on my table gives the following results:

Code:

count  ctype          cdata
2        country                19x.12x.5x.25x       
1        country                213.6.250.24x       
1        country                24.18x.34.5x       
1        country                8x.201.64.9x       
2        country                84.17x.214.16x       
2        country                87.24x.1x.1       
1        referrer        yandex.ru       
2        useragent        Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)       
3        useragent        Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)       
1        useragent        Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; MRA 4.1 (build 00975))       
1        useragent        Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; MRA 4.1 (build 00975); .NET CLR 1.1.4322)       
2        useragent        Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; MyIE2; MRA 4.3 (build 01218))

As you can see, there are no two same rows, so there should not be a need to count it twice.

MPDev 01-14-2006 04:50 PM

Look closer at your data.

MSIE 6.0; Windows NT 5.1

Code:

                                $updatecache["browser_||_$browser[bstring]"] = array($existingcache["browser_||_$browser[bstring]"]['count'], $itemcnt, $existingcache["browser_||_$browser[bstring]"]['cmisc']);
Given your example with multiple MSIE 6.0 entries, how does your code keep a cumulation of those entries?

You do not resolve your IP addresses to countries until you process the cache. So, again, where are your results cumulative for, say, US based IP addresses as you process your cache? (Again, looking at the data I posted, you can see how you only account for a single US ip address per cache processing versus the sum of all US based ips.

akanevsky 01-14-2006 04:55 PM

So are you saying that there can be two same entries with the same sessionid?

Quote:

Given your example with multiple MSIE 6.0 entries, how does your code keep a cumulation of those entries?
Oh. Now I am convinced :) Will implement your fix.

MPDev 01-14-2006 04:58 PM

As I just edited, same goes for IP addresses (as everything else); since you post process country codes you do not track the cumulative totals for country results; you only process the last entry (which is most likely only 1).

Code:

                                        $updatecache["country_||_$coucode"] = array($existingcache["country_||_$coucode"]['count'], $item['count'], $existingcache["country_||_$coucode"]['cmisc']);
country_||_US will be processed hundreds of times, but since you don't increment the results, only the last record processed is every recorded.

MPDev 01-14-2006 05:05 PM

Just as an FYI, because of the ip include scripts; larger sites like mine will need to process their cache with much more frequency than 1 hour or the memory requirements can be HUGE. (I had 15,000 records and not even 999MB of memory allocation would allow me to process it).

I'm a total data-junkie and love stuff like this - I hope you don't mind me picking it apart and finding this stuff because I want as accurate of results as possible; this kind of info is very important to advertisers and webmasters who really want to understand who is using their sites.

I'll probably add a referrer tracker to this because I really want to track actual links into my site from external sources.


All times are GMT. The time now is 01:17 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.01535 seconds
  • Memory Usage 1,751KB
  • 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
  • (3)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
  • (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