cmd

package
v0.0.0-...-c7d0b3c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2019 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use: "burn command [flags] <input>",
	Short: `A tool to convert performance profiles to hierarchical data structures that 
can be visualized as flame graphs`,
	Long: `
burn 🔥 is a CLI tool to convert performance profiles to hierarchical data
structures that can be visualized as flame graphs.

burn can also generate a self contained html flame graphs from the same data.

Examples:
  burn convert examples/out.perf
  burn convert --folded examples/out.perf-folded
  burn html examples/out.perf
	`,
	PersistentPreRun: func(cmd *cobra.Command, args []string) {
		if cpuProfile != "" {
			f, err := os.Create(cpuProfile)
			if err != nil {
				log.Fatal(err)
			}
			pprof.StartCPUProfile(f)
		}
	},

	Run: func(cmd *cobra.Command, args []string) {
		cmd.Usage()
	},
	PersistentPostRun: func(cmd *cobra.Command, args []string) {
		if cpuProfile != "" {
			pprof.StopCPUProfile()
		}
		if memProfile != "" {
			f, err := os.Create(memProfile)
			if err != nil {
				log.Fatal(err)
			}
			pprof.WriteHeapProfile(f)
			f.Close()
		}
	},
}

RootCmd represents the base command when called without any subcommands

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL