Preparation for counter update

So after a long time i plan to give my counter-engine (^^) an update.
The main Problem is, that the counter itself was perfect for ~2000 counts. But now with 5000 count, the presentation of the results is just not readable anymore.
So i plan the following things to do during the next days (i hope i will finish this during tomorrow):

  • using a new drawing method: instead of drawing the whole graph, i will draw just time-slices of a particular periode. So e.g. if you want to plot the current graph with this method, it would be necessary to draw 24 slices with a month periode.
  • to get read of lots of code within the counter/presentation script, i want to use the build-in date-calculation functions of mysql.
    So e.g.
    SELECT something FROM `counts` WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY) <= date_col; Should be perfect :-).
  • To use this functions, i have to use the build-in datetime Datatype. At the moment i am storring all counts with a unix timestamp. To make the move, i have to do three steps:
    1. creating a new field: ALTER TABLE `counts` ADD `created` DATETIME NOT NULL;
    2. migrate the old dates: UPDATE `counts` SET created = from_unixtime(unixtime);
    3. finally i had to change to insert statement within the counter script:
      “INSERT INTO `counts` ( … user_string, created) VALUES … ‘”.$user_string.”‘, NOW()) “;

More next time…

You may also like...

Leave a Reply