This python command line app is used to reproduce some metrics about a log table of a website. Those metrics beign
- Most clicked articles
- Most famous authors
- The days that more than 1% of requests led to an error.
Built with
Download the SQL data here. Run the following comand in the directory of the db: -"psql -d news -f newsdata.sql". Execute the code.
When reproducing the last metric I created two views with the respective comands:
SELECT Date(log.time), COUNT (log.time) AS numbers_good
FROM log
GROUP BY Date(log.time);
SELECT Date(log.time),
COUNT (log.time) AS numbers_bad
FROM log
WHERE log.status <> '200 OK'
GROUP BY Date(log.time);
Being the first view the overall requests and the other the requests that led to an error