-
-
Notifications
You must be signed in to change notification settings - Fork 123
Expand file tree
/
Copy pathmain.go
More file actions
33 lines (23 loc) · 746 Bytes
/
main.go
File metadata and controls
33 lines (23 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package main
import (
"fmt"
"net/http"
"github.com/kataras/iris/v12"
"github.com/arl/statsviz"
example "github.com/arl/statsviz/_example"
)
func main() {
// Force the GC to work to make the plots "move".
go example.Work()
app := iris.New()
// Need to run iris in a separate goroutine so we can start the dedicated
// http server for Statsviz.
go app.Listen(":8089")
mux := http.NewServeMux()
// Register Statsviz handlers on the mux.
_ = statsviz.Register(mux)
fmt.Println("Point your browser to http://localhost:8088/debug/statsviz")
// NewHost puts the http server for statsviz under the control of iris but
// iris won't touch its handlers.
app.NewHost(&http.Server{Addr: ":8088", Handler: mux}).ListenAndServe()
}