diff --git a/contrib/grafana/dashboard.json b/contrib/grafana/dashboard.json index 11025a0..56c6753 100644 --- a/contrib/grafana/dashboard.json +++ b/contrib/grafana/dashboard.json @@ -388,146 +388,150 @@ "title": "At Least One Dose by Age", "type": "gauge" }, { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, "datasource": null, "description": "", "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "graph": false, - "legend": false, - "tooltip": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false - }, - "decimals": 1, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [{ - "color": "dark-red", - "value": null - }, { - "color": "semi-dark-red", - "value": 40 - }, { - "color": "light-red", - "value": 50 - }, { - "color": "semi-dark-yellow", - "value": 60 - }, { - "color": "light-yellow", - "value": 70 - }, { - "color": "light-green", - "value": 80 - }, { - "color": "semi-dark-green", - "value": 90 - }] - }, - "unit": "percent" - }, + "defaults": {}, "overrides": [] }, + "fill": 0, + "fillGradient": 0, "gridPos": { "h": 8, "w": 10, "x": 0, "y": 24 }, + "hiddenSeries": false, "id": 20, - "links": [], - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom" - }, - "tooltipOptions": { - "mode": "single" - } + "legend": { + "avg": false, + "current": false, + "hideZero": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "options": { + "alertThreshold": true + }, + "percentage": false, "pluginVersion": "7.5.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, "targets": [{ "exemplar": true, - "expr": "ontvacstat_age_12_17yrs_percent_at_least_one_dose * 100", + "expr": "increase(ontvacstat_age_12_17yrs_percent_at_least_one_dose[1d]) != 0", "format": "time_series", + "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "12-17", "refId": "A" }, { "exemplar": true, - "expr": "ontvacstat_age_18_29yrs_percent_at_least_one_dose * 100", + "expr": "increase(ontvacstat_age_18_29yrs_percent_at_least_one_dose[1d]) != 0", "hide": false, "interval": "", "legendFormat": "18-29", "refId": "B" }, { "exemplar": true, - "expr": "ontvacstat_age_30_39yrs_percent_at_least_one_dose * 100", + "expr": "increase(ontvacstat_age_30_39yrs_percent_at_least_one_dose[1d]) != 0", "hide": false, "interval": "", "legendFormat": "30-39", "refId": "C" }, { "exemplar": true, - "expr": "ontvacstat_age_40_49yrs_percent_at_least_one_dose * 100", + "expr": "increase(ontvacstat_age_40_49yrs_percent_at_least_one_dose[1d]) != 0", "hide": false, "interval": "", "legendFormat": "40-49", "refId": "D" }, { "exemplar": true, - "expr": "ontvacstat_age_50_59yrs_percent_at_least_one_dose * 100", + "expr": "increase(ontvacstat_age_50_59yrs_percent_at_least_one_dose[1d]) != 0", "hide": false, "interval": "", "legendFormat": "50-59", "refId": "E" }, { "exemplar": true, - "expr": "ontvacstat_age_60_69yrs_percent_at_least_one_dose * 100", + "expr": "increase(ontvacstat_age_60_69yrs_percent_at_least_one_dose[1d]) != 0", "hide": false, "interval": "", "legendFormat": "60-69", "refId": "F" }, { "exemplar": true, - "expr": "ontvacstat_age_70_79yrs_percent_at_least_one_dose * 100", + "expr": "increase(ontvacstat_age_70_79yrs_percent_at_least_one_dose[1d]) != 0", "hide": false, "interval": "", "legendFormat": "70-79", "refId": "G" }, { "exemplar": true, - "expr": "ontvacstat_age_80_plus_percent_at_least_one_dose * 100", + "expr": "increase(ontvacstat_age_80_plus_percent_at_least_one_dose[1d]) != 0", "hide": false, "interval": "", "legendFormat": "80+", "refId": "H" }], + "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, - "title": "At Least One Dose by Age", - "type": "timeseries" + "title": "Vaccination Rate (Least One Dose by Age)", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [{ + "$$hashKey": "object:161", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, { + "$$hashKey": "object:162", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }], + "yaxis": { + "align": false, + "alignLevel": null + } }], "refresh": "1h", "schemaVersion": 27, @@ -537,7 +541,7 @@ "list": [] }, "time": { - "from": "now-3d", + "from": "now-5m", "to": "now" }, "timepicker": { @@ -563,5 +567,5 @@ "timezone": "", "title": "Ontario Vaccination Stats", "uid": "vhnVv3lMk", - "version": 77 + "version": 80 } \ No newline at end of file diff --git a/contrib/update_dashboard/ontvacstats-snapshot.json b/contrib/update_dashboard/ontvacstats-snapshot.json index a403383..108f76e 100644 --- a/contrib/update_dashboard/ontvacstats-snapshot.json +++ b/contrib/update_dashboard/ontvacstats-snapshot.json @@ -389,146 +389,150 @@ "title": "At Least One Dose by Age", "type": "gauge" }, { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, "datasource": null, "description": "", "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "graph": false, - "legend": false, - "tooltip": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false - }, - "decimals": 1, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [{ - "color": "dark-red", - "value": null - }, { - "color": "semi-dark-red", - "value": 40 - }, { - "color": "light-red", - "value": 50 - }, { - "color": "semi-dark-yellow", - "value": 60 - }, { - "color": "light-yellow", - "value": 70 - }, { - "color": "light-green", - "value": 80 - }, { - "color": "semi-dark-green", - "value": 90 - }] - }, - "unit": "percent" - }, + "defaults": {}, "overrides": [] }, + "fill": 0, + "fillGradient": 0, "gridPos": { "h": 8, "w": 10, "x": 0, "y": 24 }, + "hiddenSeries": false, "id": 20, - "links": [], - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom" - }, - "tooltipOptions": { - "mode": "single" - } + "legend": { + "avg": false, + "current": false, + "hideZero": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "options": { + "alertThreshold": true + }, + "percentage": false, "pluginVersion": "7.5.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, "targets": [{ "exemplar": true, - "expr": "ontvacstat_age_12_17yrs_percent_at_least_one_dose * 100", + "expr": "increase(ontvacstat_age_12_17yrs_percent_at_least_one_dose[1d]) != 0", "format": "time_series", + "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "12-17", "refId": "A" }, { "exemplar": true, - "expr": "ontvacstat_age_18_29yrs_percent_at_least_one_dose * 100", + "expr": "increase(ontvacstat_age_18_29yrs_percent_at_least_one_dose[1d]) != 0", "hide": false, "interval": "", "legendFormat": "18-29", "refId": "B" }, { "exemplar": true, - "expr": "ontvacstat_age_30_39yrs_percent_at_least_one_dose * 100", + "expr": "increase(ontvacstat_age_30_39yrs_percent_at_least_one_dose[1d]) != 0", "hide": false, "interval": "", "legendFormat": "30-39", "refId": "C" }, { "exemplar": true, - "expr": "ontvacstat_age_40_49yrs_percent_at_least_one_dose * 100", + "expr": "increase(ontvacstat_age_40_49yrs_percent_at_least_one_dose[1d]) != 0", "hide": false, "interval": "", "legendFormat": "40-49", "refId": "D" }, { "exemplar": true, - "expr": "ontvacstat_age_50_59yrs_percent_at_least_one_dose * 100", + "expr": "increase(ontvacstat_age_50_59yrs_percent_at_least_one_dose[1d]) != 0", "hide": false, "interval": "", "legendFormat": "50-59", "refId": "E" }, { "exemplar": true, - "expr": "ontvacstat_age_60_69yrs_percent_at_least_one_dose * 100", + "expr": "increase(ontvacstat_age_60_69yrs_percent_at_least_one_dose[1d]) != 0", "hide": false, "interval": "", "legendFormat": "60-69", "refId": "F" }, { "exemplar": true, - "expr": "ontvacstat_age_70_79yrs_percent_at_least_one_dose * 100", + "expr": "increase(ontvacstat_age_70_79yrs_percent_at_least_one_dose[1d]) != 0", "hide": false, "interval": "", "legendFormat": "70-79", "refId": "G" }, { "exemplar": true, - "expr": "ontvacstat_age_80_plus_percent_at_least_one_dose * 100", + "expr": "increase(ontvacstat_age_80_plus_percent_at_least_one_dose[1d]) != 0", "hide": false, "interval": "", "legendFormat": "80+", "refId": "H" }], + "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, - "title": "At Least One Dose by Age", - "type": "timeseries" + "title": "Vaccination Rate (Least One Dose by Age)", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [{ + "$$hashKey": "object:161", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, { + "$$hashKey": "object:162", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }], + "yaxis": { + "align": false, + "alignLevel": null + } }], "refresh": "1h", "schemaVersion": 27, @@ -538,7 +542,7 @@ "list": [] }, "time": { - "from": "now-3d", + "from": "now-5m", "to": "now" }, "timepicker": { @@ -564,7 +568,7 @@ "timezone": "", "title": "Ontario Vaccination Stats", "uid": "vhnVv3lMk", - "version": 77 + "version": 80 }, "expires": 86400, "key": "ontvacstats" diff --git a/main.go b/main.go index 48453b9..8e7b00a 100644 --- a/main.go +++ b/main.go @@ -137,7 +137,7 @@ func fetchUrl(dataUrl string) []byte { func updateMetrics() { dataUrl := "https://data.ontario.ca/api/3/action/datastore_search?sort=report_date+desc&limit=1&resource_id=8a89caa9-511c-4568-af89-7f2174b4378c" - dataAgeUrl := "https://data.ontario.ca/api/3/action/datastore_search?resource_id=775ca815-5028-4e9b-9dd4-6975ff1be021&sort=Date%20desc&limit=10" + dataAgeUrl := "https://data.ontario.ca/api/3/action/datastore_search?resource_id=775ca815-5028-4e9b-9dd4-6975ff1be021&sort=Date%20desc&limit=9" eligiblePopulation := 0.0 @@ -145,7 +145,7 @@ func updateMetrics() { data := OntCovidData{} dataErr := json.Unmarshal(dataUrlOut, &data) if dataErr != nil { - log.Println(dataErr) + log.Println(dataUrl, dataErr) return } @@ -153,7 +153,7 @@ func updateMetrics() { dataAge := OntCovidDataByAge{} dataAgeErr := json.Unmarshal(dataAgeUrlOut, &dataAge) if dataAgeErr != nil { - log.Println(dataAgeErr) + log.Println(dataAgeUrl, dataAgeErr) return }