Documentation ¶
Index ¶
- Constants
- func ExecuteCmd() error
- func GetSobject(kid *string) *sdkms.Sobject
- func Max(a, b int) int
- func StrPad(input string, padLength int, padString string, padType string) string
- type ProfilingStatistics
- type Statistic
- type TestConfig
- type TestResult
- type TestSummary
- type TestSummaryJsonWriter
- type TestSummaryPlainWriter
Constants ¶
const ( Plain string = "plain" JSON string = "json" YAML string = "yaml" )
const ( DEFAULT_USER = "" DEFAULT_USER_PASSWORD = "" )
const ASYM_EXAMPLE_DATA string = "0123456789abcdef"
const QPS_PRINT_INTERVAL = 5 * time.Second
const SIGN_EXAMPLE_DATA string = "0123456789abcdef"
const SYM_EXAMPLE_DATA string = "0123456789ABCDEF"
Variables ¶
This section is empty.
Functions ¶
func ExecuteCmd ¶
func ExecuteCmd() error
func GetSobject ¶
GetSobject retrieves a sobject through SDKMS client. It takes a keyID as a parameter and returns a pointer to a Sobject. If the keyID is empty, it will return an error. If an error occurs during the retrieval process, the function will log a fatal error and exit.
func StrPad ¶
StrPad returns the input string padded on the left, right or both sides using padType to the specified padding length padLength.
This helper function is from internet: https://gist.github.com/asessa/3aaec43d93044fc42b7c6d5f728cb039
Example:
input := "Codes";
StrPad(input, 10, " ", "RIGHT") // produces "Codes "
StrPad(input, 10, "-=", "LEFT") // produces "=-=-=Codes"
StrPad(input, 10, "_", "BOTH") // produces "__Codes___"
StrPad(input, 6, "___", "RIGHT") // produces "Codes_"
StrPad(input, 3, "*", "RIGHT") // produces "Codes"
Types ¶
type ProfilingStatistics ¶
type ProfilingStatistics struct { InQueue Statistic `json:"in_queue" yaml:"in_queue"` ParseRequest Statistic `json:"parse_request" yaml:"parse_request"` SessionLookup Statistic `json:"session_lookup" yaml:"session_lookup"` ValidateInput Statistic `json:"validate_input" yaml:"validate_input"` CheckAccess Statistic `json:"check_access" yaml:"check_access"` Operate Statistic `json:"operate" yaml:"operate"` DbFlush Statistic `json:"db_flush" yaml:"db_flush"` Total Statistic `json:"total" yaml:"total"` }
func (*ProfilingStatistics) Print ¶
func (ps *ProfilingStatistics) Print(w io.Writer)
type Statistic ¶
type Statistic struct { QueryNumber uint `json:"query_number" yaml:"query_number"` // Number of queries executed QPS float64 `json:"qps" yaml:"qps"` // Queries Per Second Avg float64 `json:"avg" yaml:"avg"` // Average response time in nanoseconds Min float64 `json:"min" yaml:"min"` // Minimum response time in nanoseconds Max float64 `json:"max" yaml:"max"` // Maximum response time in nanoseconds P50 float64 `json:"p50" yaml:"p50"` // 50th percentile (median) response time in nanoseconds P75 float64 `json:"p75" yaml:"p75"` // 75th percentile response time in nanoseconds P90 float64 `json:"p90" yaml:"p90"` // 90th percentile response time in nanoseconds P95 float64 `json:"p95" yaml:"p95"` // 95th percentile response time in nanoseconds P99 float64 `json:"p99" yaml:"p99"` // 99th percentile response time in nanoseconds }
Statistic represents the performance metrics of a load test.
func StatisticFromDurations ¶
func StatisticFromFloat64Data ¶
func StatisticFromFloat64Data(data stats.Float64Data, totalDuration *time.Duration) *Statistic
type TestConfig ¶
type TestConfig struct { TestName string `json:"test_name" yaml:"test_name"` ServerName string `json:"server_name" yaml:"server_name"` ServerPort uint16 `json:"server_port" yaml:"server_port"` VerifyTls bool `json:"verify_tls" yaml:"verify_tls"` Connections uint `json:"connections" yaml:"connections"` CreateSession bool `json:"create_session" yaml:"create_session"` WarmupDuration time.Duration `json:"warmup_duration" yaml:"warmup_duration"` TestDuration time.Duration `json:"test_duration" yaml:"test_duration"` TargetQPS uint `json:"target_qps" yaml:"target_qps"` Sobject *sdkms.Sobject `json:"sobject" yaml:"sobject"` Plugin *sdkms.Plugin `json:"plugin" yaml:"plugin"` PluginInput *json.RawMessage `json:"plugin_input" yaml:"plugin_input"` }
func (*TestConfig) Print ¶
func (tc *TestConfig) Print(w io.Writer)
type TestResult ¶
type TestResult struct { Warmup *Statistic `json:"warmup" yaml:"warmup"` Test *Statistic `json:"test" yaml:"test"` ActualTestDuration time.Duration `json:"actual_test_duration" yaml:"actual_test_duration"` SendDuration time.Duration `json:"send_duration" yaml:"send_duration"` ProfilingResults *ProfilingStatistics `json:"profiling_results" yaml:"profiling_results"` }
func (*TestResult) Print ¶
func (tr *TestResult) Print(w io.Writer)
type TestSummary ¶
type TestSummary struct { TestTime string `json:"test_time" yaml:"test_time"` // ISO 8601 timestamp string Config *TestConfig `json:"config" yaml:"config"` Result *TestResult `json:"result" yaml:"result"` }
func (*TestSummary) WritePlain ¶
func (ts *TestSummary) WritePlain(w io.Writer) error