diff --git a/CHANGELOG.md b/CHANGELOG.md index b82547017..3629d96da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,44 @@ +# Release 0.18.4 + +## What's New + +* New ziti CLI command `ziti ps set-log-level`, allows you to set the application wide log level at + runtime +* Allow invalid event types in controller config event subscriptions. Instead of failing to start, + the controller will emit a warning. This allows us to use uniform configs across controllers which + may not all support the same event types. +* Edge routers now have configurable timeouts when looking up API sessions and sessions + +## Edge Router: Configurable Session Lookup Times + +An Edge SDK client will create and api session and session with the controller first, then attempt +to use those sessions at an edge router. The controller will push session information to routers as +quickly as it can, but clients may still connect to the edge router before the client can. We +previously would wait up to 5 seconds for session to arrive before declaring a session invalid, but +would not wait for api-sessions. + +We can now wait for both api-sessions and sessions. Both timeouts are configurable. They are +configured in the router config file under listeners options. + +* `lookupApiSessionTimeout` + * How long to wait before timing out when looking up api-sessions after client connect. Default + 5 seconds. +* `lookupSessionTimeout` + * How long to wait before timing out when looking up sessions after client dial/bind. Default 5 + seconds. + +Example router config file stanza: + +``` +listeners: + - binding: edge + address: tls:0.0.0.0:6342 + options: + advertise: 127.0.0.1:6432 + lookupApiSessionTimeout: 5s + lookupSessionTimeout: 5s +``` + # Release 0.18.3 ## What's New diff --git a/etc/edge.router.yml b/etc/edge.router.yml index 2fcd55e4b..4889424ea 100644 --- a/etc/edge.router.yml +++ b/etc/edge.router.yml @@ -91,6 +91,10 @@ listeners: #maxOutstandingConnects: 100 # the number of milliseconds to wait before a hello synchronization fails and closes the connection (30ms to 60000ms, default: 1000ms) #connectTimeoutMs: 3000 + # how long to wait before timing out when looking up api-sessions after client connect. Default 5 seconds. + #lookupApiSessionTimeout: 5s + # how long to wait before timing out when looking up sessions after client dial/bind. Default 5 seconds. + #lookupSessionTimeout: 5s - binding: transport address: tls:0.0.0.0:7099 diff --git a/etc/tmpl/edge.router.yml b/etc/tmpl/edge.router.yml index 2ad429a99..03b621e1f 100644 --- a/etc/tmpl/edge.router.yml +++ b/etc/tmpl/edge.router.yml @@ -88,6 +88,10 @@ listeners: #maxOutstandingConnects: 100 # the number of milliseconds to wait before a hello synchronization fails and closes the connection (30ms to 60000ms, default: 1000ms) #connectTimeoutMs: 3000 + # how long to wait before timing out when looking up api-sessions after client connect + lookupApiSessionTimeout: 5s + # how long to wait before timing out when looking up sessions after client dial/bind + lookupSessionTimeout: 5s # - binding: proxy # address: tcp:0.0.0.0:7001 # service: loop diff --git a/go.mod b/go.mod index dbe12e7d2..8e1b771f7 100644 --- a/go.mod +++ b/go.mod @@ -24,10 +24,10 @@ require ( github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d github.com/keybase/go-ps v0.0.0-20190827175125-91aafc93ba19 github.com/michaelquigley/pfxlog v0.3.6 - github.com/openziti/edge v0.17.46 - github.com/openziti/fabric v0.15.11 - github.com/openziti/foundation v0.15.5 - github.com/openziti/sdk-golang v0.15.9 + github.com/openziti/edge v0.17.48 + github.com/openziti/fabric v0.15.13 + github.com/openziti/foundation v0.15.9 + github.com/openziti/sdk-golang v0.15.10 github.com/pborman/uuid v1.2.0 github.com/pkg/errors v0.9.1 github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 diff --git a/go.sum b/go.sum index 2a43aa27a..958b3fe7e 100644 --- a/go.sum +++ b/go.sum @@ -295,8 +295,8 @@ github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm4 github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.5 h1:kxhtnfFVi+rYdOALN0B3k9UT86zVJKfBimRaciULW4I= -github.com/google/uuid v1.1.5/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= +github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= @@ -493,17 +493,18 @@ github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoT github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= -github.com/openziti/edge v0.17.46 h1:LrWUQIZb/aF5i2mhHqAJlf/W6XIL+J9mog+/YkmBoBU= -github.com/openziti/edge v0.17.46/go.mod h1:N5dhWFiwQKa8sxPtN7hsbcqvRt3nK3WJWCNXRkn2TmE= -github.com/openziti/fabric v0.15.10/go.mod h1:hhjcEavqeQWgYvGSBeg7lwPu0Vgw/aRS8oinyj8aTos= -github.com/openziti/fabric v0.15.11 h1:iW5MKsWUwplN2H0cA2eAqRCoJw2eTrmHHUej9jQIjSo= -github.com/openziti/fabric v0.15.11/go.mod h1:hhjcEavqeQWgYvGSBeg7lwPu0Vgw/aRS8oinyj8aTos= -github.com/openziti/foundation v0.15.4 h1:Otji26Cw7F0x03cq9GBcDVXegfIyv2/1y5UDG2qs1QA= -github.com/openziti/foundation v0.15.4/go.mod h1:P2WZd04e6yBKDiGaeeHeE8r+Kt+BfDctp/y67zMkg9g= -github.com/openziti/foundation v0.15.5 h1:Ji3xLl0BnNZ209pAvHASLWQpMVmGxFJWb6ttCEiH7Ow= -github.com/openziti/foundation v0.15.5/go.mod h1:P2WZd04e6yBKDiGaeeHeE8r+Kt+BfDctp/y67zMkg9g= -github.com/openziti/sdk-golang v0.15.9 h1:fgYfj1VetQeStw8OJlGJGbMA8SQa1c2lqWR9/SR2ofY= -github.com/openziti/sdk-golang v0.15.9/go.mod h1:bn1DWyY1/ncZD72y3qCS6MFVP5ybZkAPzkZP61lkcx8= +github.com/openziti/edge v0.17.48 h1:YlelwOh0PaXgi6Udko25t/U3Cu0SZru/FCz9oPMRfFw= +github.com/openziti/edge v0.17.48/go.mod h1:KgQ3i0444fyPVIrmgiYnQ03L9CeNR016g9q0kmDFV9w= +github.com/openziti/fabric v0.15.12 h1:ZVQamwVrFzlZCmnqe8g4ZOXsUPo2g+GL8AdDplWUkew= +github.com/openziti/fabric v0.15.12/go.mod h1:B8NeRzN+eIdo2Q4JUCbP0covC5SYqerrxwJsBgCU+A8= +github.com/openziti/fabric v0.15.13 h1:GgS4Sbce6ubkDUtO2oPQFEzh5S9EiAjtMs50NJbuAvo= +github.com/openziti/fabric v0.15.13/go.mod h1:B8NeRzN+eIdo2Q4JUCbP0covC5SYqerrxwJsBgCU+A8= +github.com/openziti/foundation v0.15.8 h1:BFKDBkgsuXWgCtU7TS3eBPz2gceA057gK6W6IiyUQfM= +github.com/openziti/foundation v0.15.8/go.mod h1:34ifQ24R2EUNjakzZBKY1M4EvnOWeIYJOrJxRGdRNh4= +github.com/openziti/foundation v0.15.9 h1:Do/wohULRt+3H6mlB8SZmIUl/mbxUuN7/Lf7nbz6ZRo= +github.com/openziti/foundation v0.15.9/go.mod h1:34ifQ24R2EUNjakzZBKY1M4EvnOWeIYJOrJxRGdRNh4= +github.com/openziti/sdk-golang v0.15.10 h1:iwYTmBsEOBxcQlXuwSSBQLipUyT4QuRDFYXkf6zjyYs= +github.com/openziti/sdk-golang v0.15.10/go.mod h1:ZC5Tke4NFsRH3qcZnc9X51hGjpXlq0aOCcadgxnICYI= github.com/orcaman/concurrent-map v0.0.0-20190826125027-8c72a8bb44f6 h1:lNCW6THrCKBiJBpz8kbVGjC7MgdCGKwuvBgc7LoD6sw= github.com/orcaman/concurrent-map v0.0.0-20190826125027-8c72a8bb44f6/go.mod h1:Lu3tH6HLW3feq74c2GC+jIMS/K2CFcDWnWD9XkenwhI= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= diff --git a/ziti/cmd/ziti/cmd/ps.go b/ziti/cmd/ziti/cmd/ps.go index 12dbc7b52..f3b4200f1 100644 --- a/ziti/cmd/ziti/cmd/ps.go +++ b/ziti/cmd/ziti/cmd/ps.go @@ -81,6 +81,7 @@ func NewCmdPs(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command cmd.AddCommand(NewCmdPsPprofHeap(f, out, errOut)) cmd.AddCommand(NewCmdPsPprofCpu(f, out, errOut)) cmd.AddCommand(NewCmdPsTrace(f, out, errOut)) + cmd.AddCommand(NewCmdPsSetLogLevel(f, out, errOut)) // cmd.AddCommand(NewCmdPsController(f, out, errOut)) // cmd.AddCommand(NewCmdPsMgmt(f, out, errOut)) diff --git a/ziti/cmd/ziti/cmd/ps_gc.go b/ziti/cmd/ziti/cmd/ps_gc.go index 772b16a29..6eb66f8ba 100644 --- a/ziti/cmd/ziti/cmd/ps_gc.go +++ b/ziti/cmd/ziti/cmd/ps_gc.go @@ -20,7 +20,6 @@ import ( "github.com/openziti/foundation/agent" cmdutil "github.com/openziti/ziti/ziti/cmd/ziti/cmd/factory" cmdhelper "github.com/openziti/ziti/ziti/cmd/ziti/cmd/helpers" - "github.com/openziti/ziti/ziti/signal" "github.com/spf13/cobra" "io" "os" @@ -66,5 +65,5 @@ func (o *PsGcOptions) Run() error { if err != nil { return err } - return agent.MakeRequest(addr, signal.GC, nil, os.Stdout) + return agent.MakeRequest(addr, agent.GC, nil, os.Stdout) } diff --git a/ziti/cmd/ziti/cmd/ps_goversion.go b/ziti/cmd/ziti/cmd/ps_goversion.go index a75552d38..e7ab5dcf5 100644 --- a/ziti/cmd/ziti/cmd/ps_goversion.go +++ b/ziti/cmd/ziti/cmd/ps_goversion.go @@ -20,7 +20,6 @@ import ( "github.com/openziti/foundation/agent" cmdutil "github.com/openziti/ziti/ziti/cmd/ziti/cmd/factory" cmdhelper "github.com/openziti/ziti/ziti/cmd/ziti/cmd/helpers" - "github.com/openziti/ziti/ziti/signal" "github.com/spf13/cobra" "io" "os" @@ -66,5 +65,5 @@ func (o *PsGoversionOptions) Run() error { if err != nil { return err } - return agent.MakeRequest(addr, signal.Version, nil, os.Stdout) + return agent.MakeRequest(addr, agent.Version, nil, os.Stdout) } diff --git a/ziti/cmd/ziti/cmd/ps_memstats.go b/ziti/cmd/ziti/cmd/ps_memstats.go index 2c5c1aab3..a9fbb9df3 100644 --- a/ziti/cmd/ziti/cmd/ps_memstats.go +++ b/ziti/cmd/ziti/cmd/ps_memstats.go @@ -20,7 +20,6 @@ import ( "github.com/openziti/foundation/agent" cmdutil "github.com/openziti/ziti/ziti/cmd/ziti/cmd/factory" cmdhelper "github.com/openziti/ziti/ziti/cmd/ziti/cmd/helpers" - "github.com/openziti/ziti/ziti/signal" "github.com/spf13/cobra" "io" "os" @@ -66,5 +65,5 @@ func (o *PsMemstatsOptions) Run() error { if err != nil { return err } - return agent.MakeRequest(addr, signal.MemStats, nil, os.Stdout) + return agent.MakeRequest(addr, agent.MemStats, nil, os.Stdout) } diff --git a/ziti/cmd/ziti/cmd/ps_pprof_cpu.go b/ziti/cmd/ziti/cmd/ps_pprof_cpu.go index d0711e79a..0f6273bfb 100644 --- a/ziti/cmd/ziti/cmd/ps_pprof_cpu.go +++ b/ziti/cmd/ziti/cmd/ps_pprof_cpu.go @@ -20,7 +20,6 @@ import ( "github.com/openziti/foundation/agent" cmdutil "github.com/openziti/ziti/ziti/cmd/ziti/cmd/factory" cmdhelper "github.com/openziti/ziti/ziti/cmd/ziti/cmd/helpers" - "github.com/openziti/ziti/ziti/signal" "github.com/spf13/cobra" "io" "os" @@ -76,5 +75,5 @@ func (o *PsPprofCpuOptions) Run() error { defer out.Close() } - return agent.MakeRequest(addr, signal.CPUProfile, nil, out) + return agent.MakeRequest(addr, agent.CPUProfile, nil, out) } diff --git a/ziti/cmd/ziti/cmd/ps_pprof_heap.go b/ziti/cmd/ziti/cmd/ps_pprof_heap.go index 8f304b3c7..371c38ae3 100644 --- a/ziti/cmd/ziti/cmd/ps_pprof_heap.go +++ b/ziti/cmd/ziti/cmd/ps_pprof_heap.go @@ -20,7 +20,6 @@ import ( "github.com/openziti/foundation/agent" cmdutil "github.com/openziti/ziti/ziti/cmd/ziti/cmd/factory" cmdhelper "github.com/openziti/ziti/ziti/cmd/ziti/cmd/helpers" - "github.com/openziti/ziti/ziti/signal" "github.com/spf13/cobra" "io" "os" @@ -74,5 +73,5 @@ func (o *PsPprofHeapOptions) Run() error { defer out.Close() } - return agent.MakeRequest(addr, signal.HeapProfile, nil, out) + return agent.MakeRequest(addr, agent.HeapProfile, nil, out) } diff --git a/ziti/cmd/ziti/cmd/ps_set_log_level.go b/ziti/cmd/ziti/cmd/ps_set_log_level.go new file mode 100644 index 000000000..bf0d473df --- /dev/null +++ b/ziti/cmd/ziti/cmd/ps_set_log_level.go @@ -0,0 +1,97 @@ +/* + Copyright NetFoundry, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package cmd + +import ( + "github.com/openziti/foundation/agent" + cmdutil "github.com/openziti/ziti/ziti/cmd/ziti/cmd/factory" + cmdhelper "github.com/openziti/ziti/ziti/cmd/ziti/cmd/helpers" + "github.com/pkg/errors" + "github.com/sirupsen/logrus" + "github.com/spf13/cobra" + "io" + "os" + "strings" +) + +// PsSetgcOptions the options for the create spring command +type PsSetLogLevelOptions struct { + PsOptions + CtrlListener string +} + +// NewCmdPsLogLevel creates a command object for the "create" command +func NewCmdPsSetLogLevel(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command { + options := &PsSetLogLevelOptions{ + PsOptions: PsOptions{ + CommonOptions: CommonOptions{ + Factory: f, + Out: out, + Err: errOut, + }, + }, + } + + cmd := &cobra.Command{ + Use: "set-log-level target log-level (panic, fatal, error, warn, info, debug, trace)", + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + options.Cmd = cmd + options.Args = args + err := options.Run() + cmdhelper.CheckErr(err) + }, + } + + options.addCommonFlags(cmd) + + return cmd +} + +// Run implements the command +func (o *PsSetLogLevelOptions) Run() error { + var addr string + var err error + var levelArg string + if len(o.Args) == 1 { + addr, err = agent.ParseGopsAddress(nil) + levelArg = o.Args[0] + } else { + addr, err = agent.ParseGopsAddress(o.Args) + levelArg = o.Args[1] + } + + if err != nil { + return err + } + + var level logrus.Level + var found bool + for _, l := range logrus.AllLevels { + if strings.EqualFold(l.String(), levelArg) { + level = l + found = true + } + } + + if !found { + return errors.Errorf("invalid log level %v", levelArg) + } + + buf := []byte{byte(level)} + return agent.MakeRequest(addr, agent.SetLogLevel, buf, os.Stdout) +} diff --git a/ziti/cmd/ziti/cmd/ps_setgc.go b/ziti/cmd/ziti/cmd/ps_setgc.go index 47ce9a4a2..4acb78e97 100644 --- a/ziti/cmd/ziti/cmd/ps_setgc.go +++ b/ziti/cmd/ziti/cmd/ps_setgc.go @@ -21,7 +21,6 @@ import ( "github.com/openziti/foundation/agent" cmdutil "github.com/openziti/ziti/ziti/cmd/ziti/cmd/factory" cmdhelper "github.com/openziti/ziti/ziti/cmd/ziti/cmd/helpers" - "github.com/openziti/ziti/ziti/signal" "github.com/spf13/cobra" "io" "os" @@ -86,5 +85,5 @@ func (o *PsSetgcOptions) Run() error { buf := make([]byte, binary.MaxVarintLen64) binary.PutVarint(buf, perc) - return agent.MakeRequest(addr, signal.SetGCPercent, buf, os.Stdout) + return agent.MakeRequest(addr, agent.SetGCPercent, buf, os.Stdout) } diff --git a/ziti/cmd/ziti/cmd/ps_stack.go b/ziti/cmd/ziti/cmd/ps_stack.go index 9e246cf72..791cbbe22 100644 --- a/ziti/cmd/ziti/cmd/ps_stack.go +++ b/ziti/cmd/ziti/cmd/ps_stack.go @@ -20,7 +20,6 @@ import ( "github.com/openziti/foundation/agent" cmdutil "github.com/openziti/ziti/ziti/cmd/ziti/cmd/factory" cmdhelper "github.com/openziti/ziti/ziti/cmd/ziti/cmd/helpers" - "github.com/openziti/ziti/ziti/signal" "github.com/spf13/cobra" "io" "os" @@ -66,5 +65,5 @@ func (o *PsStackOptions) Run() error { if err != nil { return err } - return agent.MakeRequest(addr, signal.StackTrace, nil, os.Stdout) + return agent.MakeRequest(addr, agent.StackTrace, nil, os.Stdout) } diff --git a/ziti/cmd/ziti/cmd/ps_stats.go b/ziti/cmd/ziti/cmd/ps_stats.go index 54ff67a6e..3b617baf1 100644 --- a/ziti/cmd/ziti/cmd/ps_stats.go +++ b/ziti/cmd/ziti/cmd/ps_stats.go @@ -20,7 +20,6 @@ import ( "github.com/openziti/foundation/agent" cmdutil "github.com/openziti/ziti/ziti/cmd/ziti/cmd/factory" cmdhelper "github.com/openziti/ziti/ziti/cmd/ziti/cmd/helpers" - "github.com/openziti/ziti/ziti/signal" "github.com/spf13/cobra" "io" "os" @@ -66,5 +65,5 @@ func (o *PsStatsOptions) Run() error { if err != nil { return err } - return agent.MakeRequest(addr, signal.Stats, nil, os.Stdout) + return agent.MakeRequest(addr, agent.Stats, nil, os.Stdout) } diff --git a/ziti/cmd/ziti/cmd/ps_trace.go b/ziti/cmd/ziti/cmd/ps_trace.go index d68b72bae..6d27d863b 100644 --- a/ziti/cmd/ziti/cmd/ps_trace.go +++ b/ziti/cmd/ziti/cmd/ps_trace.go @@ -20,7 +20,6 @@ import ( "github.com/openziti/foundation/agent" cmdutil "github.com/openziti/ziti/ziti/cmd/ziti/cmd/factory" cmdhelper "github.com/openziti/ziti/ziti/cmd/ziti/cmd/helpers" - "github.com/openziti/ziti/ziti/signal" "github.com/spf13/cobra" "io" "os" @@ -64,5 +63,5 @@ func (o *PsTraceOptions) Run() error { if err != nil { return err } - return agent.MakeRequest(addr, signal.Trace, nil, os.Stdout) + return agent.MakeRequest(addr, agent.Trace, nil, os.Stdout) } diff --git a/ziti/cmd/ziti/cmd/pscmd.go b/ziti/cmd/ziti/cmd/pscmd.go index f296f8332..497a7b025 100644 --- a/ziti/cmd/ziti/cmd/pscmd.go +++ b/ziti/cmd/ziti/cmd/pscmd.go @@ -19,6 +19,7 @@ package cmd import ( "errors" "fmt" + "github.com/openziti/foundation/agent" "io" "io/ioutil" "net" @@ -27,13 +28,12 @@ import ( "strconv" "strings" - "github.com/openziti/ziti/ziti/signal" "github.com/openziti/ziti/ziti/util" ) func trace(addr net.TCPAddr, _ []string) error { fmt.Println("Tracing now, will take 5 secs...") - out, err := cmd(addr, signal.Trace) + out, err := cmd(addr, agent.Trace) if err != nil { return err } diff --git a/ziti/signal/signal.go b/ziti/signal/signal.go deleted file mode 100644 index cf53eb46c..000000000 --- a/ziti/signal/signal.go +++ /dev/null @@ -1,50 +0,0 @@ -/* - Copyright NetFoundry, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -// Package signal contains signals used to communicate to the gops agents. -package signal - -const ( - // StackTrace represents a command to print stack trace. - StackTrace = byte(0x1) - - // GC runs the garbage collector. - GC = byte(0x2) - - // MemStats reports memory stats. - MemStats = byte(0x3) - - // Version prints the Go version. - Version = byte(0x4) - - // HeapProfile starts `go tool pprof` with the current memory profile. - HeapProfile = byte(0x5) - - // CPUProfile starts `go tool pprof` with the current CPU profile - CPUProfile = byte(0x6) - - // Stats returns Go runtime statistics such as number of goroutines, GOMAXPROCS, and NumCPU. - Stats = byte(0x7) - - // Trace starts the Go execution tracer, waits 5 seconds and launches the trace tool. - Trace = byte(0x8) - - // BinaryDump returns running binary file. - BinaryDump = byte(0x9) - - // SetGCPercent sets the garbage collection target percentage. - SetGCPercent = byte(0x10) -)