Moved the polling of data from the webgui to its own dedicated poller.

This should simplify testing of webgui.
This commit is contained in:
Hendrik van Wyk
2015-02-28 15:14:15 +02:00
parent 2b63a81cec
commit 3cd2faf3ef
6 changed files with 239 additions and 57 deletions

View File

@@ -44,7 +44,8 @@ func main() {
flag.Parse()
source := datasource.NewJSONSource(*url)
gui := webgui.NewWebGui(source, 10*time.Second, 100)
poller := datasource.NewDataPoller(source, 10*time.Second)
gui := webgui.NewWebGui(poller, 100)
http.Handle("/", gui)
http.Handle("/munin", http.HandlerFunc(gui.ServeMuninHTTP))
http.Handle("/muninconfig", http.HandlerFunc(gui.ServeMuninConfigHTTP))