OpenTechFund / bypass-otf_proxy

1 stars 1 forks source link

Store log analysis reports in database #10

Closed maxpearl closed 4 years ago

maxpearl commented 4 years ago

In order to allow users to read their own stats, store log analysis reports in the database, keyed by domain.

maxpearl commented 4 years ago

Current table (more granular):

 Column       |            Type             | Collation | Nullable |                 Default                 
-------------------+-----------------------------+-----------+----------+-----------------------------------------
 id                | integer                     |           | not null | nextval('log_reports_id_seq'::regclass)
 domain_id         | integer                     |           |          | 
 date_of_report    | timestamp without time zone |           |          | 
 report            | character varying           |           |          | 
 first_date_of_log | timestamp without time zone |           |          | 
 hits              | numeric                     |           |          | 
 last_date_of_log  | timestamp without time zone |           |          | 

Log reports are stored in the database when they are generated, either locally, or by reading from S3.