Hi, Rene

I took a quick look over your code ...

I kind-of like the idea having all logging at one place, but the code is a
bit too messy if you ask me :)
If you would have put it on github and I would fork it - the first thing
I'd do is trying to get rid of the hm-lib and rewriting all in a bit more
object-oriented style, but that's just personal taste ;)
Specially the function rajmvServiceLog_graphs_raphael_calculateData() with
a code of ca. 280 lines is quite long ...
Additionally I think that setting an error-handler who's just returning
false is not a good way. Why not disable error-handling or write code that
produces no errors?

I think it would be good to mention that you're using the library adodb (
http://adodb.sourceforge.net/) and sitewide_rv (is it that?
http://mediabeez.ws/) or am I guessing wrong?

You're talking about a sql-file ... has my anti-virus-program removed
something here?

Please don't see that as destructive critic, but as hints what I would do
if I get to do with this code.


On Mon, May 21, 2012 at 12:46 PM, rene7705 <rene7...@gmail.com> wrote:

> Hi.
> I wasn't happy with the fact that Google Analytics doesn't record many
> of the hits on my sites, so I decided to roll my own analytics
> software, and opensource it.
> It's now in a state where I can request early comments.
> You can view a demo at http://mediabeez.ws/stats (under construction,
> may fail at times) (browser compatibility may be an issue, I built it
> with chrome, should work in firefox too, but won't (ever) in IE.)
> If you click on the graph while the details for a given day are
> visible, you will see the errors for that day in a DIV below the
> graph.
> Normally you'd hide the error details and $hits for anyone's who's not
> registred as a developer, of course. I've turned it on for all at the
> moment, so you can comment on that feature and review my results array
> $hits.
> I've opted, for simplicity of design, to store all settings I thought
> could be remotely interesting in a mysql db (see attached sql init
> file) (which is filled from PHP every time a page is delivered, and
> again from JS when the page has initialized fully, or does a HTML5
> History API location.href change), and then use PHP to retrieve all
> rows for a given datetime-range, and do the totals calculations in a
> php loop.
> I'm only keeping 1 row from the db in memory at any given time, but
> I'm building up a large deep array with the totals information in the
> php loop that goes over the rows.
> I'm wondering if this is a good approach, though. Maybe I should let
> the totals be calculated by the mysql server instead.
> I was thinking to let the totals calculations stay in php, and be
> executed from a cron job every hour. Only for the current month would
> you need to re-calculate every hour.
> I haven't figured out yet how to for instance only re-calculate the
> last hour, store results per hour, and then calculate the day and
> month totals from that "hourly cache" data when needed.
> I don't have a clue about how big companies do their totals
> calculations (for sites that get way more hits than mine, which is
> something i'd like to be able to support with my own analytics code),
> and would like to know how big companies do this.
> I've included the relevant draft code as attachment files to this
> mail, for your review. Please let me know if I have forgotten to
> include relevant code..
> As always, thanks for your time,
>  Rene
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to