cmd

package
v0.0.0-...-3d664b2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2017 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ExitOK is exit code on success.
	ExitOK int = iota
	// ExitNG is exit code on error.
	ExitNG
)
View Source
const (
	// DateCol is Date column number.
	DateCol = 0
)

Variables

View Source
var (
	// OutCsv is csv output path.
	OutCsv string
	// OutExcel is excel output path.
	OutExcel string

	// AverageCnt output count.
	AverageCnt int
	// MedianCnt output count.
	MedianCnt int
	// ModeCnt output count.
	ModeCnt int
	// RangeCnt output count.
	RangeCnt int
	// MaxCnt output count.
	MaxCnt int
	// VarianceCnt output count.
	VarianceCnt int

	// RmCsv is whether remove output csv.
	RmCsv bool

	// Begin is begin of data range. (HHMMSS)
	Begin string

	// End is end of data range. (HHMMSS)
	End string

	// Match is regexp target performance name.
	Match string

	// Ignore is regexp ignore target performance name.
	Ignore string

	// Ymax is chart max value.
	Ymax int64
	// Ymin is chart min value.
	Ymin int64

	// DateTimeVec is DateTime vector.
	DateTimeVec = make([]string, 0)
)
View Source
var RootCmd = &cobra.Command{
	Use:   "anaperf path/to/mcodir",
	Short: "Analyze performance data.",
	Long: `Analyze performance csv data
For example:

	anaperf path/to/perfdata.csv

`,
	RunE: runE,
}

RootCmd represents the base command when called without any subcommands

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func Execute

func Execute()

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

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

Types

type DataRow

type DataRow struct {
	DateTime string
	Data     float64
}

DataRow is data record.

type Perf

type Perf struct {
	Name string
	Data []DataRow

	Sum      float64
	Average  float64
	Median   float64
	Mode     float64
	Range    float64
	Max      float64
	Variance float64
}

Perf is performance data.

type Perfs

type Perfs []Perf

Perfs is Perf slice.

Jump to

Keyboard shortcuts

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