Documentation ¶
Index ¶
- Constants
- Variables
- func AddAllSharedParameters(cmd *cobra.Command)
- func AddConfigParameter(cmd *cobra.Command)
- func AddLoggingParameters(cmd *cobra.Command)
- func AddOverrideParameters(cmd *cobra.Command)
- func ConfigOverrideLogSettings(cfg *config.Config) error
- func Execute()
- func HasPipe() (bool, error)
- func IsLaunchedByDebugger() bool
- func MultiErrorCode(err *multierror.Error) int
- func PrintOverrides(overrides []string)
- func ReadObjectDefinitions() error
- func TruncatedMultiErrorMessage(err *multierror.Error) string
- type JSONParseError
- type JSONValidateError
- type LogFormatError
- type MaxErrorsReachedError
- type MetricError
- type MetricLevel
- type ObjectDefError
- type OsError
- type ProfilingError
- type SummaryTypeError
Constants ¶
const ( // ExitCodeExecutionError error during execution ExitCodeExecutionError int = 0x80 + iota // ExitCodeJSONParseError error parsing JSON config ExitCodeJSONParseError // ExitCodeJSONValidateError validating JSON config failed ExitCodeJSONValidateError // ExitCodeLogFormatError error resolving log format ExitCodeLogFormatError // ExitCodeObjectDefError error reading object definitions ExitCodeObjectDefError // ExitCodeProfilingError error starting profiling ExitCodeProfilingError // ExitCodeMetricError error starting prometheus ExitCodeMetricError // ExitCodeOsError error when interacting with host OS ExitCodeOsError // ExitCodeSummaryTypeError incorrect summary type ExitCodeSummaryTypeError // ExitCodeConnectionError error during test connection ExitCodeConnectionError // ExitCodeAppStructure error during get app structure ExitCodeAppStructure // ExitCodeMissingParameter ExitCodeMissingParameter // ExitCodeForceQuit ExitCodeForceQuit // ExitCodeMaxErrorsReached ExitCodeMaxErrorsReached )
Unfortunately go doesn't support negative exit codes, so same logic as sdkexerciser can't be used (positive for error count and negative for other errors) as exit codes seems to be limited to 8 bits (even though defined as an int), we will use setting the highest bit as a representation of negative values, i.e. errors not corresponding to simulation errors. Exit codes with highest bit set to 0 corresponds to error count from simulation, where 0x7F will represent >127 errors.
Variables ¶
var RootCmd = &cobra.Command{
Use: "gopherciser",
Short: "User simulation tool",
Long: `Tool to simulate user actions in a sense application`,
}
RootCmd represents the base command when called without any sub-commands
Functions ¶
func AddAllSharedParameters ¶
AddAllSharedParameters add shared parameters to command
func AddConfigParameter ¶
AddConfigParameter add config file parameter to command
func AddLoggingParameters ¶ added in v0.5.2
AddLoggingParameters add logging parameters to command
func AddOverrideParameters ¶ added in v0.6.15
AddOverrideParameters to command
func ConfigOverrideLogSettings ¶ added in v0.5.2
ConfigOverrideLogSettings override log settings with parameters
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.
func IsLaunchedByDebugger ¶ added in v0.11.4
func IsLaunchedByDebugger() bool
IsLaunchedByDebugger discovers if pararent process is deleve
func MultiErrorCode ¶ added in v0.13.3
func MultiErrorCode(err *multierror.Error) int
MultiErrorCode error count truncated to 0x7F
func PrintOverrides ¶ added in v0.6.15
func PrintOverrides(overrides []string)
PrintOverrides to script
func ReadObjectDefinitions ¶
func ReadObjectDefinitions() error
func TruncatedMultiErrorMessage ¶ added in v0.13.3
func TruncatedMultiErrorMessage(err *multierror.Error) string
TruncatedMultiErrorMessage to first message + error count
Types ¶
type JSONParseError ¶
type JSONParseError string
JSONParseError error during unmarshal of JSON file
func (JSONParseError) Error ¶
func (err JSONParseError) Error() string
Error implementation of Error interface
type JSONValidateError ¶
type JSONValidateError string
JSONValidateError error during validation of JSON file
func (JSONValidateError) Error ¶
func (err JSONValidateError) Error() string
Error implementation of Error interface
type LogFormatError ¶
type LogFormatError string
LogFormatError error resolving log format
func (LogFormatError) Error ¶
func (err LogFormatError) Error() string
Error implementation of Error interface
type MaxErrorsReachedError ¶ added in v0.13.3
MaxErrorsReachedError max errors limit was reached during execution
func (MaxErrorsReachedError) Error ¶ added in v0.13.3
func (err MaxErrorsReachedError) Error() string
Error max error limit reached
type MetricError ¶
type MetricError string
MetricError error starting profiling
func (MetricError) Error ¶
func (err MetricError) Error() string
Error implementation of Error interface
type MetricLevel ¶ added in v0.17.5
type MetricLevel int
MetricLevel indicates what level if any to expose metrics, default is no metrics
const ( MetricOff MetricLevel = iota MetricPull MetricPush MetricPushAPI )
MetricsLevel enum
func (MetricLevel) GetEnumMap ¶ added in v0.17.5
func (value MetricLevel) GetEnumMap() *enummap.EnumMap
type ObjectDefError ¶
type ObjectDefError string
ObjectDefError error reading object definitions
func (ObjectDefError) Error ¶
func (err ObjectDefError) Error() string
Error implementation of Error interface
type ProfilingError ¶
type ProfilingError string
ProfilingError error starting profiling
func (ProfilingError) Error ¶
func (err ProfilingError) Error() string
Error implementation of Error interface
type SummaryTypeError ¶
type SummaryTypeError string
SummaryTypeError incorrect summary type
func (SummaryTypeError) Error ¶
func (err SummaryTypeError) Error() string
Error incorrect summary type