-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloadgen.dsl
119 lines (114 loc) · 2.69 KB
/
loadgen.dsl
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# // How to use DSL to simplify requests, requests defined in loadgen.yml will be skipped in this mode
# // $ES_ENDPOINT=https://localhost:9200 ES_USERNAME=admin ES_PASSWORD=b14612393da0d4e7a70b ./bin/loadgen -run loadgen.dsl
# runner: {
# total_rounds: 1,
# no_warm: true,
# // Whether to log all requests
# log_requests: false,
# // Whether to log all requests with the specified response status
# log_status_codes: [0, 500],
# assert_invalid: false,
# assert_error: false,
# // Whether to reset the context, including variables, runtime KV pairs,
# // etc., before this test run.
# reset_context: false,
# default_endpoint: "$[[env.ES_ENDPOINT]]",
# default_basic_auth: {
# username: "$[[env.ES_USERNAME]]",
# password: "$[[env.ES_PASSWORD]]",
# }
# },
# variables: [
# {
# name: "ip",
# type: "file",
# path: "dict/ip.txt",
# // Replace special characters in the value
# replace: {
# '"': '\\"',
# '\\': '\\\\',
# },
# },
# {
# name: "id",
# type: "sequence",
# },
# {
# name: "id64",
# type: "sequence64",
# },
# {
# name: "uuid",
# type: "uuid",
# },
# {
# name: "now_local",
# type: "now_local",
# },
# {
# name: "now_utc",
# type: "now_utc",
# },
# {
# name: "now_utc_lite",
# type: "now_utc_lite",
# },
# {
# name: "now_unix",
# type: "now_unix",
# },
# {
# name: "now_with_format",
# type: "now_with_format",
# // https://programming.guide/go/format-parse-string-time-date-example.html
# format: "2006-01-02T15:04:05-0700",
# },
# {
# name: "suffix",
# type: "range",
# from: 10,
# to: 1000,
# },
# {
# name: "bool",
# type: "range",
# from: 0,
# to: 1,
# },
# {
# name: "list",
# type: "list",
# data: ["medcl", "abc", "efg", "xyz"],
# },
# {
# name: "id_list",
# type: "random_array",
# variable_type: "number", // number/string
# variable_key: "suffix", // variable key to get array items
# square_bracket: false,
# size: 10, // how many items for array
# },
# {
# name: "str_list",
# type: "random_array",
# variable_type: "number", // number/string
# variable_key: "suffix", // variable key to get array items
# square_bracket: true,
# size: 10, // how many items for array
# replace: {
# // Use ' instead of " for string quotes
# '"': "'",
# // Use {} instead of [] as array brackets
# "[": "{",
# "]": "}",
# },
# },
# ],
DELETE /medcl
PUT /medcl
POST /medcl/_doc/1
{
"name": "medcl"
}
POST /medcl/_search
{ "track_total_hits": true, "size": 0, "query": { "terms": { "patent_id": [ $[[id_list]] ] } } }