From fb1f1c034088049acd3c34e194466ba835a28a01 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Mon, 16 Nov 2020 14:29:56 +0000 Subject: [PATCH] Enable Google Cloud profiling --- go.mod | 3 ++- go.sum | 9 +++++---- main.go | 9 +++++++++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 76905ee5..04659a88 100644 --- a/go.mod +++ b/go.mod @@ -14,6 +14,7 @@ require ( github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/elithrar/simple-scrypt v1.3.0 github.com/google/go-cmp v0.5.3 // indirect + github.com/google/pprof v0.0.0-20201109224723-20978b51388d // indirect github.com/gorilla/websocket v1.4.2 github.com/hjson/hjson-go v3.1.0+incompatible github.com/mattn/go-colorable v0.1.8 // indirect @@ -34,5 +35,5 @@ require ( golang.org/x/text v0.3.4 golang.org/x/tools v0.0.0-20201116002733-ac45abd4c88c // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20201113130914-ce600e9a6f9e // indirect + google.golang.org/genproto v0.0.0-20201116123041-bf037d74fda1 // indirect ) diff --git a/go.sum b/go.sum index 76a5bb8f..4bc357cd 100644 --- a/go.sum +++ b/go.sum @@ -44,8 +44,6 @@ github.com/abcum/bump v0.0.0-20201116071400-31a74cba5f19 h1:FmvfNT034i2bxnBu18IL github.com/abcum/bump v0.0.0-20201116071400-31a74cba5f19/go.mod h1:4I2T23JoKcYIVfkro3Y5Lkay4kqEyna5FmLfkHgcTb8= github.com/abcum/cork v0.0.0-20201116072055-6b3677fdfab1 h1:HRy+gOcIbmHi2CHY/kVgbqJN0igBNj20Cl4u4Eg9d2g= github.com/abcum/cork v0.0.0-20201116072055-6b3677fdfab1/go.mod h1:4NyuORcAT6R8JYsS+CDcBa0TmSPnP7n0Kxrxiq9EZLw= -github.com/abcum/fibre v0.0.0-20201116072313-07fa416362b2 h1:B9dvnw2Pt/V8wZaH/OcoIdi7CEkTHwq96Bwrx2AeCCo= -github.com/abcum/fibre v0.0.0-20201116072313-07fa416362b2/go.mod h1:naD9ybsRTyR816GnsLj4QQsh9fKfQSutemK/zrTYJto= github.com/abcum/fibre v0.0.0-20201116105551-0b75e530e0cd h1:fLIbWEyjW1FVN1DCKS465Dayc6ZEdQpYvn4AALm4udg= github.com/abcum/fibre v0.0.0-20201116105551-0b75e530e0cd/go.mod h1:naD9ybsRTyR816GnsLj4QQsh9fKfQSutemK/zrTYJto= github.com/abcum/rixxdb v0.0.0-20201116083534-c988f1e5d2bb h1:iS1RpYDGSvhFoCzO2zTMMXLPNG7KS+ezm38i9rpDwuM= @@ -153,7 +151,10 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c h1:Jx2lEv4nMccTJE+IIZOVIvk+DjNKlRsW0sm1uBr896U= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201109224723-20978b51388d h1:l48/ohaaIyJbCld0g0U9nO8mTv4E7QMopIiiOFtJB5Y= +github.com/google/pprof v0.0.0-20201109224723-20978b51388d/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= @@ -581,8 +582,8 @@ google.golang.org/genproto v0.0.0-20201030142918-24207fddd1c3/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201106154455-f9bfe239b0ba/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb h1:MoNcrN5yaH+35Ge8RUwFbL7ekwq9ED2fiDpgWKrR29w= google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201113130914-ce600e9a6f9e h1:jRAe+6EDD0LNrVzmjx7FxBivivOZTKnXMbH5lvmxLP8= -google.golang.org/genproto v0.0.0-20201113130914-ce600e9a6f9e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201116123041-bf037d74fda1 h1:KOf1oTHwGQGxeRpLSgmeQsE4QtOoULhft9DBO5Lcdx0= +google.golang.org/genproto v0.0.0-20201116123041-bf037d74fda1/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/main.go b/main.go index e001694d..76cab3f7 100644 --- a/main.go +++ b/main.go @@ -21,7 +21,10 @@ import ( "github.com/pkg/profile" + "cloud.google.com/go/profiler" + "github.com/abcum/surreal/cli" + "github.com/abcum/surreal/util/build" ) func main() { @@ -37,6 +40,12 @@ func main() { runtime.GOMAXPROCS(runtime.NumCPU()) + profiler.Start(profiler.Config{ + ProjectID: "surreal-io", + Service: "surreal", + ServiceVersion: build.GetInfo().Ver, + }) + cli.Init() }