How do people count the number of hits they have on a Zope website? -- John
John Poltorak wrote:
How do people count the number of hits they have on a Zope website?
You are inprecise here. Please define "count hits" Do you mean a simplehit counter for one or more pages, or do you mean complete statistics? -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science
On Wed, Sep 29, 2004 at 10:28:57AM +0200, Max M wrote:
John Poltorak wrote:
How do people count the number of hits they have on a Zope website?
You are inprecise here. Please define "count hits"
Do you mean a simplehit counter for one or more pages, or do you mean complete statistics?
I'm none too clear myself, I hoped people would understand what is meant by a 'hit'. Websites often say they have so many 'hits' per day. I mean whatever they mean.
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/ IT's Mad Science
-- John
Hi, On Wed, 2004-09-29 at 10:32, John Poltorak wrote:
On Wed, Sep 29, 2004 at 10:28:57AM +0200, Max M wrote:
John Poltorak wrote:
How do people count the number of hits they have on a Zope website?
You are inprecise here. Please define "count hits"
Do you mean a simplehit counter for one or more pages, or do you mean complete statistics?
I'm none too clear myself, I hoped people would understand what is meant by a 'hit'. Websites often say they have so many 'hits' per day. I mean whatever they mean.
Well, like you, there is basically nobody really knowing "whatever that means". No matter if they are still constantly speaking about this. Remember: this is marketing So you have 2 kind of figures, where one is precise and has a meaning and the other is mostly rubbish (depends on your setup) One figure is how many and how often how many bytes are loaded off your webserver. This is in the access logs. Either Z2.log or for example the apache log if you use apache in front of your zope - as most ppl. do. This tells you used bandwidth, peaks, "not found" and other status information, how much cached responses and so on. You can use this figure to plan your server hardware/software. The other figure is the vague imagination of having people out there, physically represented by their computers which browse thru your site and load a page with embedded objects each time so you have kind of a trail and perhaps see how many times a given page is "viewed". But: you dont know. You never know. Unless you have a very strong session management where you forbid and inhibit any caching and let only known users get in and _never_ cache anything. Then you would have a chance of exact numbers as of which elements were loaded - but you dont know if the user actually looked at it :-) There are in fact a lot of caches - and you want them to have nice performance - so the 2nd figure is far from exact in any way. If marketing people insists of having such numbers use any logfilefaker script you find appropriate - the faked numbers are as good as any "believed to be measured" ones. Regards Tino
Look at var/Z2.log. This a common-logfile-format compatible logfile. You can use *any* analyzer to create reports. Google or search through the archives of the list to find related postings or tool recommendations (FAQ). -aj --On Mittwoch, 29. September 2004 9:24 Uhr +0100 John Poltorak <jp@warpix.org> wrote:
How do people count the number of hits they have on a Zope website?
-- John
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[ John Poltorak ] ------------------- | > How do people count the number of hits they have on a Zope website? In addition to the previous responses, you can use two approaches to have ¨some measurement¨, it is up to you to decide if they serve your purposes <wink>: 1) Run webalizer (http://www.mrunix.net/webalizer/) over your Z2.log file. Just use (-F clf) option. This will generate a html report with graphics and tables. 2) If you want to count how many times a single published object is referenced. You can always count each access incrementing a property through 'manage_changeProperties()', very rudimentary and yet very simple to implement. best regards, Rod Senra
Hi,
2) If you want to count how many times a single published object is referenced. You can always count each access incrementing a property through 'manage_changeProperties()', very rudimentary and yet very simple to implement. I'm not sure, but I think that perhaps the Cache manager implements this much better. I haven't looked at the source code, so, I can't say how this is done.
Anyway, I think that using an external log analyzer would be better. Regards, Josef
--On Mittwoch, 29. September 2004 14:06 Uhr -0300 Rodrigo Senra <rodsenra@gpr.com.br> wrote:
2) If you want to count how many times a single published object is referenced. You can always count each access incrementing a property through 'manage_changeProperties()', very rudimentary and yet very simple to implement.
You really should do it that way! This will blow up your ZODB for *every* hit. -aj
--On Mittwoch, 29. September 2004 19:13 Uhr +0200 Andreas Jung <lists@andreas-jung.com> wrote:
--On Mittwoch, 29. September 2004 14:06 Uhr -0300 Rodrigo Senra <rodsenra@gpr.com.br> wrote:
2) If you want to count how many times a single published object is referenced. You can always count each access incrementing a property through 'manage_changeProperties()', very rudimentary and yet very simple to implement.
You really should do it that way!
**NOT* missing!
From: "Andreas Jung" <lists@andreas-jung.com>
--On Mittwoch, 29. September 2004 14:06 Uhr -0300 Rodrigo Senra <rodsenra@gpr.com.br> wrote:
2) If you want to count how many times a single published object is referenced. You can always count each access incrementing a property through 'manage_changeProperties()', very rudimentary and yet very simple to implement.
You really should do it that way! This will blow up your ZODB for *every* hit.
What if you were to use a property field on a temp_folder (ram), then the zodb would be accessed, and it should be faster? Jonathan
Rodrigo Senra wrote:
2) If you want to count how many times a single published object is referenced. You can always count each access incrementing a property through 'manage_changeProperties()', very rudimentary and yet very simple to implement.
Or install mxmCounter If you feel lucky at: http://www.google.com/search?q=zope+hit+counter -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science
Assuming you want to display a number on a page, which is typically what underlings ask for, here is one way to do it. This is for a site that has a single master page template containing macros called by a simple template for each page. Put this in the master template: <div tal:condition="template/PageCount | nothing" tal:omit-tag=""> <p align="center" tal:content="structure here/page_count_tool">Page Counter</p> </div> In the slave template create a PageCount boolean property, which is true (1) to count or false (0) to not count. Our users can click a check box to switch counting on or off as required. This is the page_count_tool dtml method: <dtml-call "REQUEST.set('url', URL0)"> <dtml-try> <dtml-call page_count_initialise> <dtml-except> </dtml-try> <dtml-try> <dtml-call page_count_update> <dtml-in page_count_list> <span class=whatever><dtml-var COUNT></span> </dtml-in> <dtml-except> </dtml-try> This may not be the most efficient way to code - it was done when I was learning Zope - and I did not really pluck up the courage to be a helper untill following the recent "disgraceful" thread. Still not sure if the blind should be leading the blind. Nevertheless, to continue.. The page count is kept in a database. So you need a PAGECOUNT table: URL varchar(255) PRIMARY KEY COUNT int(11) and separate insert and update ZSQL Methods: INSERT INTO PAGECOUNT (COUNT, URL) VALUES (0, <dtml-sqlvar url type=nb>) UPDATE PAGECOUNT SET COUNT = COUNT + 1 WHERE URL = <dtml-sqlvar url type=nb> I don't use page counts much myself, but occasionally it is useful to know if a page is worth maintaining at all! Regards Cliff Ford John Poltorak wrote:
How do people count the number of hits they have on a Zope website?
participants (8)
-
Andreas Jung -
Cliff Ford -
John Poltorak -
Jonathan Hobbs -
Josef Meile -
Max M -
Rodrigo Senra -
Tino Wildenhain