fixes for second dose and coverstion on that value
This commit is contained in:
parent
2adf91be36
commit
6b60e2d2e8
9
main.go
9
main.go
@ -7,6 +7,7 @@ import (
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"github.com/cabify/gotoprom"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
@ -76,8 +77,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 json.Number `json:"Percent_at_least_one_dose"`
|
||||
PercentFullyVaccinated json.Number `json:"Percent_fully_vaccinated"`
|
||||
PercentAtLeastOneDose string `json:"Percent_at_least_one_dose"`
|
||||
PercentFullyVaccinated string `json:"Percent_fully_vaccinated"`
|
||||
} `json:"records"`
|
||||
Limit int `json:"limit"`
|
||||
Links struct {
|
||||
@ -199,11 +200,11 @@ func updateMetrics() {
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
percentAtLeastOneDose, err := record.PercentAtLeastOneDose.Float64()
|
||||
percentAtLeastOneDose, err := strconv.ParseFloat(record.PercentAtLeastOneDose, 64)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
percentFullyVaccinated, err := record.PercentAtLeastOneDose.Float64()
|
||||
percentFullyVaccinated, err := strconv.ParseFloat(record.PercentFullyVaccinated, 64)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user