webcompat / webcompat-metrics-server

Server in charge of delivering different data to the webcompat-metrics-client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Move json data to the DB

karlcow opened this issue · comments

I want to try to import the JSON data into the DB.
This needs an import script.

All the data that needs to move:

  • needsdiagnosis count
  • needstriage count
  • sitewait count
  • needscontact count
  • weekly reports

All data for the first four categories has been shifted to the database [including any available data from before the scripts started running as well as the missing data we missed by disabling the scripts with PR #108 (fixed in PR #112)].

Adding the weekly reports data is in progress:

  • Add third table to DB, models.py — weekly_total
  • Add weekly script to query daily_total and insert into weekly_total

Notes to self:

  • Script should run every Monday, well after daily script has completed — maybe 4am?)
  • Script should sum totals of previous Monday through Sunday (yesterday) and add the resulting weekly total to DB with PREVIOUS Monday's timestamp (e.g., the weekly total for June 17-23 should be timestamped 2019-06-17)