Seperate Fetch Action From Generation of Reports and Graphs
Problem
Right now the script that fetches metric data is directly coupled with the part of the script that generates visualizations, reports and graphs. This is bad for maintaining the site in the long run as you would need to re-collect data in order to re-generate a report or a graph which is not ideal.
Solution
I have separated the script into three separate scripts; one to fetch data, one to generate reports, and one to generate graphs.
Result
Store old metrics from last week of collection as {path}.old file so that comparison can be generated separately
Add gen_graphs.sh to generate graphs
Add gen_reports.sh to generate reports
Add method read_current_metric_data to read the status of both the .old and regular json files
Added update-reports-and-graphs job to cicd.yml to generate graphs and reports right before the site is pushed
Seperate Fetch Action From Generation of Reports and Graphs
Problem
Right now the script that fetches metric data is directly coupled with the part of the script that generates visualizations, reports and graphs. This is bad for maintaining the site in the long run as you would need to re-collect data in order to re-generate a report or a graph which is not ideal.
Solution
I have separated the script into three separate scripts; one to fetch data, one to generate reports, and one to generate graphs.
Result
{path}.old
file so that comparison can be generated separatelyread_current_metric_data
to read the status of both the.old
and regular json filesupdate-reports-and-graphs
job tocicd.yml
to generate graphs and reports right before the site is pushed