Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var LoadtestCmd = &cobra.Command{ Use: "loadtest url", Short: "Run a generic load test against an Eth/EVM style JSON-RPC endpoint.", Long: usage, RunE: func(cmd *cobra.Command, args []string) error { err := runLoadTest(cmd.Context()) if err != nil { return err } return nil }, Args: func(cmd *cobra.Command, args []string) error { zerolog.DurationFieldUnit = time.Second zerolog.DurationFieldInteger = true if len(args) != 1 { return fmt.Errorf("expected exactly one argument") } url, err := url.Parse(args[0]) if err != nil { log.Error().Err(err).Msg("Unable to parse url input error") return err } if url.Scheme != "http" && url.Scheme != "https" && url.Scheme != "ws" && url.Scheme != "wss" { return fmt.Errorf("the scheme %s is not supported", url.Scheme) } inputLoadTestParams.URL = url r := regexp.MustCompile(fmt.Sprintf("^[%s]+$", strings.Join(validLoadTestModes, ""))) if !r.MatchString(*inputLoadTestParams.Mode) { return fmt.Errorf("the mode %s is not recognized", *inputLoadTestParams.Mode) } if *inputLoadTestParams.AdaptiveBackoffFactor <= 0.0 { return fmt.Errorf("the backoff factor needs to be non-zero positive") } return nil }, }
LoadtestCmd represents the loadtest command
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.