From 2a3415d03a43b774874cd19e8d61c417799cdeca Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Fri, 29 Apr 2016 02:01:15 -0700 Subject: [PATCH] exmaple/cmd: upgrade to new traceapp.New API --- examples/cmd/webapp-influxdb/main.go | 10 +++++++++- examples/cmd/webapp-opentracing/main.go | 10 +++++++++- examples/cmd/webapp/main.go | 10 +++++++++- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/examples/cmd/webapp-influxdb/main.go b/examples/cmd/webapp-influxdb/main.go index a4545edc..a26a0b32 100644 --- a/examples/cmd/webapp-influxdb/main.go +++ b/examples/cmd/webapp-influxdb/main.go @@ -4,6 +4,7 @@ import ( "fmt" "log" "net/http" + "net/url" "time" "sourcegraph.com/sourcegraph/appdash" @@ -57,7 +58,14 @@ func main() { log.Fatal(err) } }() - tapp := traceapp.New(nil) + url, err := url.Parse("http://localhost:8700") + if err != nil { + log.Fatal(err) + } + tapp, err := traceapp.New(nil, url) + if err != nil { + log.Fatal(err) + } tapp.Store = store tapp.Queryer = store tapp.Aggregator = store diff --git a/examples/cmd/webapp-opentracing/main.go b/examples/cmd/webapp-opentracing/main.go index 5d77d43b..e07aa33f 100644 --- a/examples/cmd/webapp-opentracing/main.go +++ b/examples/cmd/webapp-opentracing/main.go @@ -9,6 +9,7 @@ import ( "fmt" "log" "net/http" + "net/url" "os" "strings" "time" @@ -42,7 +43,14 @@ func main() { // on HTTP port 8700 will bring us to the web UI, displaying information // about this specific web-server (another alternative would be to connect // to a centralized Appdash collection server). - tapp := traceapp.New(nil) + url, err := url.Parse("http://localhost:8700") + if err != nil { + log.Fatal(err) + } + tapp, err := traceapp.New(nil, url) + if err != nil { + log.Fatal(err) + } tapp.Store = store tapp.Queryer = memStore log.Println("Appdash web UI running on HTTP :8700") diff --git a/examples/cmd/webapp/main.go b/examples/cmd/webapp/main.go index 9e1b2317..218d1e0a 100644 --- a/examples/cmd/webapp/main.go +++ b/examples/cmd/webapp/main.go @@ -9,6 +9,7 @@ import ( "fmt" "log" "net/http" + "net/url" "time" "sourcegraph.com/sourcegraph/appdash" @@ -49,7 +50,14 @@ func main() { // on HTTP port 8700 will bring us to the web UI, displaying information // about this specific web-server (another alternative would be to connect // to a centralized Appdash collection server). - tapp := traceapp.New(nil) + url, err := url.Parse("http://localhost:8700") + if err != nil { + log.Fatal(err) + } + tapp, err := traceapp.New(nil, url) + if err != nil { + log.Fatal(err) + } tapp.Store = store tapp.Queryer = memStore log.Println("Appdash web UI running on HTTP :8700")