mirror of
https://github.com/empayre/fleet.git
synced 2024-11-07 17:28:54 +00:00
0bb9d69ece
Adds endpoints and fleetctl commands to retrieve various debug profiles from the Fleet server. The best summary is from the help text: ``` fleetctl debug NAME: fleetctl debug - Tools for debugging Fleet USAGE: fleetctl debug command [command options] [arguments...] COMMANDS: profile Record a CPU profile from the Fleet server. cmdline Get the command line used to invoke the Fleet server. heap Report the allocated memory in the Fleet server. goroutine Get stack traces of all goroutines (threads) in the Fleet server. trace Record an execution trace on the Fleet server. archive Create an archive with the entire suite of debug profiles. OPTIONS: --config value Path to the Fleet config file (default: "/Users/zwass/.fleet/config") [$CONFIG] --context value Name of Fleet config context to use (default: "default") [$CONTEXT] --help, -h show help ```
21 lines
318 B
Go
21 lines
318 B
Go
package main
|
|
|
|
import "github.com/urfave/cli"
|
|
|
|
const (
|
|
outfileFlagName = "outfile"
|
|
)
|
|
|
|
func outfileFlag() cli.Flag {
|
|
return cli.StringFlag{
|
|
Name: outfileFlagName,
|
|
Value: "",
|
|
EnvVar: "OUTFILE",
|
|
Usage: "Path to output file",
|
|
}
|
|
}
|
|
|
|
func getOutfile(c *cli.Context) string {
|
|
return c.String(outfileFlagName)
|
|
}
|