This week was spent mostly with graphs, and display.

We decided to use flot with jQuery for graphing. Data is fetched asynchronously with JavaScript/jQuery from “/logstatistic/json/{id}”. “{id}” is substituted with the id of the report.

Graphing can be done for any report. In order to display something with a graph we have to provide the folowwing information in the YAML file:

display:
limit: 10
mapping:
xaxis: '#'
yaxis: 'count'
type: 'bar'

The display and limit parts have to be given for every report. “limit” is the number of rows we show in the table initially. If the user wants to see every row, they can click a “show more” link. “xaxis” and “yaxis” are the columns of the query result we want to use as the x and y axes of the chart. The “type” field is not supported yet, but I will create support for more graph types very soon.

Graphs are tables are displayed side by side now. If a report doesn’t have a graph, the table is scaled to full size.

When a query returns mbids we return entity names instead. Now I made the querying script return links to these entities as well.

I also added filtering. This is what a filter looks like if its given for a report in the YAML file:

filter:
- unknown_artists:
column: 'mbid'
values:
- 'f92c4ae1-fc81-4c54-b1b6-336cc0a1f338'
- '4d307588-7e57-4032-bde6-5f217fc09b2a'
- '125ec42a-7229-4250-afc5-e057484327fe'

There can be more filters for a report. Filters have a name, but it doesn’t have any special role. There is a column specified for each filter, and a list of values. The results that have one of these values in that column are thrown away when querying happens. This way we can filter out “unknown” artists from the top artists report, for example.

We have reached the “soft pencils down” date, but I will still code on the last week. Robert made daily data feeding into splunk possible, so I will probably work on that this week.

Advertisements