-----Original Message----- From: Tom Deprez [mailto:tom.deprez@village.uunet.be] Sent: Saturday, May 15, 1999 6:48 AM To: zope@zope.org Subject: [Zope] ZClass hitCounter
Ok, I've managed to get the increment of the counter from an instance :
<!--#with counter--> <!--#call propertysheets.propHitCounter.manage_changeProperties(hitCount =hitCount+1)--
<!--#var counter--> <!--/#with-->
I assume that in your code you have quotes around that expression, otherwise it wont work.
Now, I want to have a method 'inc' in the product HitCounter which increments the hitCount...
how to get this done? I can't get it to work.... I don't even know how to call this method, because : 1. nothing happes, or 2. I can system is unavailable... with
It apears that Howard Shaw helped you with the techhnical details here, so I just have a bit of a warning you might want to avoid. If your counter is incrimented on each page access, then your object database will grow on each hit. Because the object database stores revisions of objects, each new inciment of the property will append a new revision on the ned of the database. For a million hit per day website, this means a million new objects will be added to the database. Definately performance prohibitive. If you want to make a Counter product, I would suggest writing part of it in python, and making the actual hit count a volitle object. This would require some caching logic (to preserve the hit count across system resets) and some other magic. I believe someone a month or so ago someone allready jumped through most of these hoops. I would suggest either using/modifing their code or working from it to write your own. -Michel
1.
<!--#with counter--> <!--#call increment--> <!--#var counter--> <!--/#with-->
2.
<!--#with counter--> <!--#call "increment"--> <!--#var counter--> <!--/#with-->
And what do I've to place in the DTML method 'increment'....
Please, can somebody help me?
Tom.
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(For developer-specific issues, use the companion list, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
On Sun, 16 May 1999, Michel Pelletier wrote:
It apears that Howard Shaw helped you with the techhnical details here, so I just have a bit of a warning you might want to avoid. If your counter is incrimented on each page access, then your object database will grow on each hit. Because the object database stores revisions of objects, each new inciment of the property will append a new revision on the ned of the database. For a million hit per day website, this means a million new objects will be added to the database. Definately performance prohibitive.
If you want to make a Counter product, I would suggest writing part of it in python, and making the actual hit count a volitle object. This would require some caching logic (to preserve the hit count across system resets) and some other magic. I believe someone a month or so ago someone allready jumped through most of these hoops. I would suggest either using/modifing their code or working from it to write your own.
A simple solution is to write an external method that sores the counter value in a regular file, lets say in the Zope/var directory. pavlos
Pavlos Christoforou wrote:
Because the object database stores revisions of objects, each new inciment of the property will append a new revision on the ned of the database. For a million hit per day website, this means a million new objects will be added to the database. Definately performance prohibitive. ...
A simple solution is to write an external method that sores the counter value in a regular file, lets say in the Zope/var directory.
Maybe there should be some way to disable storing of old versions of an object, where Undo isn't necessary? The Gimp for example has a similar command. -- Itamar - itamars@ibm.net
"Itamar S.-T." wrote:
Pavlos Christoforou wrote:
Because the object database stores revisions of objects, each new inciment of the property will append a new revision on the ned of the database. For a million hit per day website, this means a million new objects will be added to the database. Definately performance prohibitive. ...
A simple solution is to write an external method that sores the counter value in a regular file, lets say in the Zope/var directory.
Maybe there should be some way to disable storing of old versions of an object, where Undo isn't necessary? The Gimp for example has a similar command.
In Zope 2, there will (eventually, not initially, but not to long from now :) be an option for using multiple databases in a Zope site. You'll be able to combine databases designed to support undo (e.g. FileStorage) with databases that don't support undo and handle fast changing data better (e.g. dbmStorage, DCOracleSimpleStorage, etc.). There is a similar issue with versions. Jim -- Jim Fulton mailto:jim@digicool.com Python Powered! Technical Director (888) 344-4332 http://www.python.org Digital Creations http://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
participants (4)
-
Itamar S.-T. -
Jim Fulton -
Michel Pelletier -
Pavlos Christoforou