How can I create a statistic module?

seephoto

Joined: 2005-12-12
Posts: 6
Posted: Mon, 2006-03-27 03:27

I want to add a page that logon user can see some info about statistic info of the database. eg. How many users use gallery today, how many user post how many pics today?....
The basic way is to add a module, when end user open the page to see these info, module will do a search for current database and return back the result.
But I think this is not effecient, The process to search database will cost time, User may need pretty long time to wait for response.
Now I think two way to hack this.
1.the first request will do search, then write result to database(or file, I don't know how to do this) with a timestamp. the second request will check if already have a similar request in one hour(eg.) based on the timestamp. If yes, it will not search DB and return the last cached result.
2.create a background thread to do database search and store the result to DB or file. User will get it directly.
Can you guys suggest which is better and feasible?

 
Dick Knod

Joined: 2006-02-18
Posts: 20
Posted: Mon, 2006-03-27 23:41
seephoto wrote:
I want to add a page that logon user can see some info about statistic info of the database. eg. How many users use gallery today, how many user post how many pics today?....
The basic way is to add a module, when end user open the page to see these info, module will do a search for current database and return back the result.
But I think this is not effecient, The process to search database will cost time, User may need pretty long time to wait for response.
Now I think two way to hack this.
1.the first request will do search, then write result to database(or file, I don't know how to do this) with a timestamp. the second request will check if already have a similar request in one hour(eg.) based on the timestamp. If yes, it will not search DB and return the last cached result.
2.create a background thread to do database search and store the result to DB or file. User will get it directly.
Can you guys suggest which is better and feasible?

Maybe u should check this forum topic its about statistic module,
http://gallery.menalto.com/node/41326