Home

Nov. 22nd, 2007

To The Side

Updates on AWStats

The AWStats project is coming along really well. :-) I've been makings lots of progress--getting closer and closer to having everything templatized.

One of the nice things about refactoring is that development tends to move faster and faster as you go along. A big part of refactoring is setting up convenient ways of doing things that you need to do frequently. So, as you do the same thing over and over, your refactoring just made your life easier and easier.

For example, in the original AWStats, each new chart was a huge mass of code. Now, adding new charts only involves setting a few variables. It's also much easier to read and understand the code.

My little victories are in how much smaller the main file gets. :-D Because of the original architecture of the program, it's hard to move things outside of the main file. But even so, the file is getting smaller. Even though my lines are nearly always 80 characters or less, and many of the original lines are longer than 100 or 160 characters!

Once everything is templatized, then I can go on to other things, like sprucing up the user interface or maybe refactoring the log-analysis code (though I may just leave that untouched for a while).

-Max
Tags: ,

Nov. 17th, 2007

To The Side

My Latest Side-Project

So, I haven't said much about it to anybody, but for a few weeks I've been working on re-writing AWStats. It's a fairly-popular program that generates charts and graphs based on your web server's logs, so you can see how many hits, visits, etc. that you're getting. It makes lots of different charts and graphs.

However, the code is pretty messy, and it's not maintained very much by its current author. I emailed him, and he said that I should go ahead and make my changes, and he'll either incorporate my patches into AWStats or I can just call it something different and ship it myself.

I've been making a lot of progress. My first focus has been to take all of the HTML output and put it into templates using the Template Toolkit, which leads to a lot of code cleanup. That's what I'm still working on now, though I've made a lot of progress on it. It's probably also led to security improvements, since I've been correctly filtering things.

I've also started to make the code use CGI.pm instead of manually sending HTTP headers and manually parsing the URL query string.

So far (I think I've worked about six or seven days cumulatively on it) the changes I've made can be represented as a patch of about 4700 lines and 203KB. For anybody who doesn't know these things, that's a huge amount of development. And that's just how big it all is as one patch--if we counted each change I made separately, it'd probably get closer to 6000 lines.

I think this will be a pretty good thing to do, because the current status of all open-source web-log analyzers is:

Webalizer: Hasn't been updated in years.
Analog: Hasn't been updated in years.
AWStats: Maintained only barely, probably full of security holes, very messy code.

And that's it. So since I know Perl pretty well (and AWStats is in Perl), I figured it would be a good thing to re-write and get out there.

-Max
Tags: ,
To The Side

November 2009

S M T W T F S
1234567
891011121314
15161718192021
22232425262728
2930     

Advertisement

Syndicate

RSS Atom
Powered by LiveJournal.com