This week codereview still doesn’t work. I tried uploading many different diff files, but no combination seemed to work. I noticed something weird here, but I’m not sure I understand properly:

https://github.com/metabrainz/musicbrainz-server-log-analysis/network

If you look at the graph, there is a commit before the merging, and I don’t know how that is possible.

Anyways, this week Robert reviewed my querying script. You can find the (new) code here:

https://github.com/metabrainz/musicbrainz-server-log-analysis/blob/master/querying/run_queries.py

I tried to make some order in the repository. Robert said we should not use a csv file for storing queries. We should either store them in the database or in code. With help from Oliver I decided to go with YAML. I’ve just learned about it, but it’s a very nice tool for representing data-structures, and storing it in a human-readable way. You can also find the queries.yml file in the repository.

One of the other things Robert suggested was to make a config file for the script. The config file contains the credentials for the database, and also for Splunk. I also changed the way queries.yml is referenced. So far it was passed as an argument, and my original thought was to store the path in the config file. Rob said it’s okay to refer to it statically, so I made the script that way. I created a default config file, with the real username/password missing, and uploaded it to the repository.

I forked the musicbrainz-server repository, and right now I’m learning about the perl modules that are created for every table in the database. I should eventually make a module like that for the table “log_statistic” in the database. I’ll commit the changes I make to my fork of the repository.

Next week I should make a simple module, that displays a report on the website. Robert said the learning curve is quite steep, so I will spend as much time as possible learning how things work, experimenting. He also said displaying reports (and graphs, etc.) might take up the rest of the project in time.

Advertisements