tailcfg: add MapResponse.Debug mechanism to trigger logging heap pprof

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2020-04-07 22:24:06 -07:00
committed by Brad Fitzpatrick
parent b0c10fa610
commit 703d789005
4 changed files with 102 additions and 0 deletions
+13
View File
@@ -500,6 +500,19 @@ type MapResponse struct {
Roles []Role
// TODO: Groups []Group
// TODO: Capabilities []Capability
// Debug is normally nil, except for when the control server
// is setting debug settings on a node.
Debug *Debug `json:",omitempty"`
}
// Debug are instructions from the control server to the client
// to adjust debug settings.
type Debug struct {
// LogHeapPprof controls whether the client should logs
// its heap pprof data. Each true value sent from the server
// means that client should do one more log.
LogHeapPprof bool `json:",omitempty"`
}
func (k MachineKey) String() string { return fmt.Sprintf("mkey:%x", k[:]) }