The "fix the stats" patches

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





I just finished poking through the patches proffered by Nigel Metheringham
and Marian Durkovic that promise to fix the statistics problems.

Well, combined, looks like they do.  And they also changed the
meaning of "proxy" in the stats.  If you had a cache miss before, you
request was "proxied" to the server, and both the into-cache and proxied
stats should be incremented.  Now, on a cache miss, when your request
is proxied, only if the server is set to PROXY-ONLY mode are the proxy
bytes added to the tally.  All articles, cached or uncached, are
proxied when they are first retrieved, that how you get em!

If this isn't clear, consider the situation where you have one server
which you actually cache article from, another which you only proxy.  If
you request a 10k file from each, the stats (with these patches) would
look like...

patched...
--out-of-cache -----into-cache hits ----------proxy
  0   0			1  10k		1  10k

the original behavior was (in 0.87.6)...
--out-of-cache -----into-cache hits ----------proxy
  0   0			1  10k		2  20k


If you then request both articles AGAIN...

patched...
--out-of-cache -----into-cache hits ----------proxy
  1   10k		1  10k		 2 20k

orig in in 0.87.6...
--out-of-cache -----into-cache hits ----------proxy
  1   10k		1  10k		 3 30k


I haven't decided which is the most desirable yet, but with the current
system-wide stats, I guess I like the old behavior better.  What I'd
really like to do is hack in per-server stats, in which case I guess
the new behavior would be OK. :)

It happened like this...
	Nigel made a 50% correct stab at fixing the stats.  The correct
	part was incremening the cache stats on a cache hit, the wrong
	part was also doing the same on proxies.

	Marian fixed this.  Although it could have been fixed by just putting
	it back the way it was, the patch supplied moves the proxy tally
	code around at out of the way, and now tests to see if the
	server is running in proxy only mode.

If you want the original proxy couting behavior back, you can comment
out the "else" in article.c...

738                                  }
739                                  crosspost (art_stack, getbyid? artfile: buf, (type==c_stat)? c_head: type, getbyid);
740                          }
741                  } else
742                  {
743
744                          if (con.statistics)
745                          {
746                                  switch (type)
747                                  {
 

-- 
Aaron Nabil
nabil@teleport.com


[Index of Archives]     [Yosemite]     [Yosemite Campsites]     [Bugtraq]     [Linux]     [Trn]

Powered by Linux