Commit 64ce7dff authored by Cecylia Bocovich's avatar Cecylia Bocovich
Browse files

Changed time resolution for metrics collection

Set the resolution of metrics data collection to be every 24 hours
parent cd650fa0
......@@ -13,6 +13,8 @@ var (
once sync.Once
)
const metricsResolution = 24 * time.Hour
type CountryStats struct {
counts map[string]int
}
......@@ -94,7 +96,7 @@ func NewMetrics(metricsLogger *log.Logger) (*Metrics, error) {
// Write to log file every hour with updated metrics
go once.Do(func() {
heartbeat := time.Tick(time.Hour)
heartbeat := time.Tick(metricsResolution)
for range heartbeat {
metricsLogger.Println("Country stats: ", m.countryStats.Display())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment