This repository has been archived by the owner on Jan 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
model.go
71 lines (67 loc) · 2.06 KB
/
model.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package main
/*
* Example workload config
spec_version: '0.1.0'
workloads:
- teststrategy: performance
vuser: 200
loopcount: 50
script: load.jmx
- teststrategy: performance_light
vuser: 50
loopcount: 10
script: load.jmx
- teststrategy: functional
vuser: 1
loopcount: 1
script: func.jmx
*/
const (
JMeterConfFilename = "jmeter/jmeter.conf.yaml"
TestStrategy_Performance = "performance"
TestStrategy_Functional = "functional"
TestStrategy_HealthCheck = "healthcheck"
TestStrategy_RealUser = "real-user"
)
// JMeterConf contains the workload configuration for JMeter
type JMeterConf struct {
SpecVersion string `json:"spec_version" yaml:"spec_version"`
Workloads []*Workload `json:"workloads" yaml:"workloads"`
}
// Workload contains information about a JMeter workload to be executed
type Workload struct {
TestStrategy string `json:"teststrategy" yaml:"teststrategy"`
VUser int `json:"vuser" yaml:"vuser"`
LoopCount int `json:"loopcount" yaml:"loopcount"`
ThinkTime int `json:"thinktime" yaml:"thinktime"`
Script string `json:"script" yaml:"script"`
AcceptedErrorRate float32 `json:"acceptederrorrate" yaml:"acceptederrorrate"`
AvgRtValidation int `json:"avgrtvalidation" yaml:"avgrtvalidation"`
Properties map[string]string `json:"properties" yaml:"properties"`
}
var defaultWorkloads = []Workload{
{
TestStrategy: TestStrategy_HealthCheck,
VUser: 1,
LoopCount: 1,
ThinkTime: 250,
Script: "jmeter/basiccheck.jmx",
AcceptedErrorRate: 0.0,
},
{
TestStrategy: TestStrategy_Performance,
VUser: 10,
LoopCount: 500,
ThinkTime: 250,
Script: "jmeter/load.jmx",
AcceptedErrorRate: 0.1,
},
{
TestStrategy: TestStrategy_Functional,
VUser: 1,
LoopCount: 1,
ThinkTime: 250,
Script: "jmeter/load.jmx",
AcceptedErrorRate: 0.1,
},
}