perf

package
v0.0.0-...-9e9d5e8 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrReadFilepathCode             = "1118"
	ErrNoProfileNameCode            = "1119"
	ErrNoTestURLCode                = "1120"
	ErrNotValidURLCode              = "1121"
	ErrFailMarshalCode              = "1122"
	ErrFailUnmarshalCode            = "1123"
	ErrNoProfileFoundCode           = "1124"
	ErrInvalidOutputChoiceCode      = "1125"
	ErrUnauthenticatedCode          = "1126"
	ErrFailUnmarshalFileCode        = "1127"
	ErrInvalidTestConfigFileCode    = "1128"
	ErrArgumentOverflowCode         = "1129"
	ErrInvalidJSONFileCode          = "1130"
	ErrHealthCheckerCode            = "1131"
	ErrPerformanceProfileResultCode = "1132"
)

Please reference the following before contributing an error code: https://docs.khulnasoft.com/project/contributing/contributing-error https://github.com/khulnasoft/meshkit/blob/master/errors/errors.go

Variables

View Source
var PerfCmd = &cobra.Command{
	Use:   "perf",
	Short: "Performance Management",
	Long: `Performance Management & Benchmarking.
Find more information at: https://docs.khulnasoft.com/reference/meshplayctl#command-reference`,
	Example: `
// Run performance test:
meshplayctl perf apply test-3 --name "a quick stress test" --url http://192.168.1.15/productpage --qps 300 --concurrent-requests 2 --duration 30s
	
// List performance profiles:
meshplayctl perf profile sam-test

// List performance results:
meshplayctl perf result sam-test

// Display Perf profile in JSON or YAML:
meshplayctl perf result -o json
meshplayctl perf result -o yaml
`,

	RunE: func(cmd *cobra.Command, args []string) error {
		if len(args) == 0 {
			return cmd.Help()
		}
		if ok := utils.IsValidSubcommand(availableSubcommands, args[0]); !ok {
			availableSubCmds := []string{"apply", "profile", "result"}

			suggestedCmd := utils.FindClosestArg(args[0], availableSubCmds)
			if suggestedCmd != "" && suggestedCmd[0] == args[0][0] {
				return errors.New(utils.PerfError(fmt.Sprintf("'%s' is an invalid command for '%s'. Did you mean this?\n\t%s\n", args[0], cmd.CalledAs(), suggestedCmd)))
			}
			return errors.New(utils.PerfError(fmt.Sprintf("'%s' is an invalid command for '%s'. Use 'meshplayctl perf --help' to display usage guide.\n", args[0], cmd.CalledAs())))
		}
		return nil
	},
}

PerfCmd represents the Performance Management CLI command

Functions

func ErrFailMarshal

func ErrFailMarshal(err error) error

func ErrFailUnmarshal

func ErrFailUnmarshal(err error) error

func ErrFailUnmarshalFile

func ErrFailUnmarshalFile(err error) error

func ErrHealthChecker

func ErrHealthChecker(err error) error

func ErrInvalidJSONFile

func ErrInvalidJSONFile() error

func ErrInvalidOutputChoice

func ErrInvalidOutputChoice() error

func ErrInvalidTestConfigFile

func ErrInvalidTestConfigFile() error

func ErrNoProfileFound

func ErrNoProfileFound() error

func ErrNoProfileName

func ErrNoProfileName() error

func ErrNoTestURL

func ErrNoTestURL() error

func ErrNotValidURL

func ErrNotValidURL() error

func ErrPerformanceProfileResult

func ErrPerformanceProfileResult(err error) error

func ErrReadFilepath

func ErrReadFilepath(err error) error

func ErrorArgumentOverflow

func ErrorArgumentOverflow() error

Types

This section is empty.

Jump to

Keyboard shortcuts

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