diff --git a/go.mod b/go.mod index 5dbbf24..b255ab4 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.15 require ( fortio.org/dnsping v1.1.4 // indirect + github.com/arl/statsviz v0.2.1 // indirect github.com/docker/docker-credential-helpers v0.6.3 ) diff --git a/go.sum b/go.sum index 4dda99c..a1b73c6 100644 --- a/go.sum +++ b/go.sum @@ -4,6 +4,8 @@ fortio.org/dnsping v1.1.4/go.mod h1:5y9DK7NFTU9s9w+FiqmwKxpl3eKyc4QI2aXdUiQUvoQ= fortio.org/fortio v1.11.0 h1:p9lNbmYFat4ZcjSR3ojsCS2Wnw52FqGsRdG0sRxRx5Q= fortio.org/fortio v1.11.0/go.mod h1:sbKl3MB8+XZTZ4HvLcBPUvFYPmMKG5zKsoCmgbo/YR8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/arl/statsviz v0.2.1 h1:hjfBf5GLMd77tTALAThs6BWwGx4gZZoVeamahwu/ZKQ= +github.com/arl/statsviz v0.2.1/go.mod h1:Dg/DhcWPSzBVk70gVbZWcymzHDkYRhVpeScx5l+Zj7o= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= diff --git a/read-only-chan.go b/read-only-chan.go index 9443657..5a3f22c 100644 --- a/read-only-chan.go +++ b/read-only-chan.go @@ -4,6 +4,9 @@ import ( "fmt" "log" "net" + "net/http" + + "github.com/arl/statsviz" ) func produce(l *net.TCPListener, c chan<- net.Conn) { @@ -45,5 +48,12 @@ func main() { if err != nil { log.Fatalln(err) } + + statsviz.RegisterDefault() + go func() { + log.Println("start listening on port 6060 for statsviz") + log.Println(http.ListenAndServe(":6060", nil)) + }() + produce(l, c) }