Yay! I passed the midterm evaluations! Also, Oliver (ocharles) was kind enough to look at my log sanitizing scripts and he said they were okay. This is what I’ve been doing through this week:

I spent most of the time reading and understanding code. I also had to refresh my Perl knowledge a bit. After that I tried making my own module for the server log analysis project. These are the files that were created on the way:

https://github.com/balidani/musicbrainz-server/blob/master/lib/MusicBrainz/Server/Controller/LogStatistic.pm

The module above is the controller. The subroutine log_statistics gets called when one navigates to the page musicbrainz.org/logstatistics. This code is of course not running on the actual MusicBrainz server yet. It runs on the sandbox Ian created for me a few weeks ago. It can be found here: http://plaintext.mbsandbox.org/. So when the subroutine runs it lets the server know about the path for the template and the data to display. The data to display is collected from the database in this module:

https://github.com/balidani/musicbrainz-server/blob/master/lib/MusicBrainz/Server/Data/LogStatistic.pm

The get_single_statistic function (yeah, subroutine) queries the database for all statistics and returns a single one. Later this function will be replaced, this is just for testing now. The statistic the function returns is an “object” (entity) I have created. This is the module for it:

https://github.com/balidani/musicbrainz-server/blob/master/lib/MusicBrainz/Server/Entity/LogStatistic.pm

So far this module is the same as the rows in the database. This, and everything else, might change later. The simple template the controller refers to is here:

https://github.com/balidani/musicbrainz-server/blob/master/root/logstatistics/index.tt

Later, when JSON data is actually parsed, it will be displayed in a nice table. I tried parsing the JSON data stored in the database, but I ran into a few problems. First of all, I wasn’t storing JSON in the first place (what a blunder, I know). After I corrected the querying script (it’s committed in the repo now), I tried running the queries again on the server. The next problem I ran into was that our Splunk license expired yesterday. Now I have to talk to Robert about this, and try to continue with something that doesn’t need Splunk.

Next week I’ll spend more time trying to get data displayed. We will have to decide how to organize, and where to put things on the site.

Advertisements