Removes unused chart titles and increase scrape time

This commit is contained in:
A. Svensson 2017-09-09 13:41:08 +02:00
parent 51685c55d9
commit 427a47d054
3 changed files with 6 additions and 6 deletions

View File

@ -49,7 +49,7 @@ func (a *App) renderChart(w http.ResponseWriter, c renderableChart) error {
return nil
}
func makeHistoryChart(title string, showLegend bool, points []ServerPoint) chart.Chart {
func makeHistoryChart(showLegend bool, points []ServerPoint) chart.Chart {
// TODO BUG: one day is missing randomly (usually the 3rd day in the range) in the chart
var xVals []time.Time
var yVals []float64
@ -107,7 +107,7 @@ func makeHistoryChart(title string, showLegend bool, points []ServerPoint) chart
}
// NOTE: The chart won't be renderable unless we've got at least two days of history
func makeDayAverageChart(title string, points []ServerPoint) chart.BarChart {
func makeDayAverageChart(points []ServerPoint) chart.BarChart {
days := make(map[time.Weekday][]int)
for _, p := range points {
day := p.Time.Weekday()

View File

@ -20,7 +20,7 @@ func main() {
WebAddr: *flagAddr,
ReadTimeout: 30 * time.Second,
WriteTimeout: 30 * time.Second,
ScrapeTimeout: 10 * time.Minute,
ScrapeTimeout: 15 * time.Minute,
Storage: &ss13_se.StorageSqlite{
Path: *flagPath,
},

View File

@ -70,7 +70,7 @@ func (a *App) pageDailyChart(w http.ResponseWriter, r *http.Request, vars handle
}
}
c := makeHistoryChart("Daily history", true, points)
c := makeHistoryChart(true, points)
return a.renderChart(w, c)
}
@ -87,7 +87,7 @@ func (a *App) pageWeeklyChart(w http.ResponseWriter, r *http.Request, vars handl
}
}
c := makeHistoryChart("Weekly history", false, points)
c := makeHistoryChart(false, points)
return a.renderChart(w, c)
}
@ -104,6 +104,6 @@ func (a *App) pageAverageChart(w http.ResponseWriter, r *http.Request, vars hand
}
}
c := makeDayAverageChart("Average per day", points)
c := makeDayAverageChart(points)
return a.renderChart(w, c)
}