revert commit as datasource got fixed

main
Ray Slakinski 2021-08-01 15:04:48 -04:00
parent 5e5e7491cf
commit bacc9e149b
1 changed files with 4 additions and 5 deletions

View File

@ -7,7 +7,6 @@ import (
"io/ioutil"
"log"
"net/http"
"strconv"
"github.com/cabify/gotoprom"
"github.com/prometheus/client_golang/prometheus"
@ -77,8 +76,8 @@ type OntCovidDataByAge struct {
AtLeastOneDoseCumulative json.Number `json:"At least one dose_cumulative"`
SecondDoseCumulative json.Number `json:"Second_dose_cumulative"`
TotalPopulation json.Number `json:"Total population"`
PercentAtLeastOneDose string `json:"Percent_at_least_one_dose"`
PercentFullyVaccinated string `json:"Percent_fully_vaccinated"`
PercentAtLeastOneDose json.Number `json:"Percent_at_least_one_dose"`
PercentFullyVaccinated json.Number `json:"Percent_fully_vaccinated"`
} `json:"records"`
Limit int `json:"limit"`
Links struct {
@ -200,11 +199,11 @@ func updateMetrics() {
if err != nil {
log.Println(err)
}
percentAtLeastOneDose, err := strconv.ParseFloat(record.PercentAtLeastOneDose, 64)
percentAtLeastOneDose, err := record.PercentAtLeastOneDose.Float64()
if err != nil {
log.Println(err)
}
percentFullyVaccinated, err := strconv.ParseFloat(record.PercentFullyVaccinated, 64)
percentFullyVaccinated, err := record.PercentFullyVaccinated.Float64()
if err != nil {
log.Println(err)
}