-
Notifications
You must be signed in to change notification settings - Fork 205
/
flow_abtest.yaml
200 lines (200 loc) · 3.84 KB
/
flow_abtest.yaml
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
key: flow_abtest
version: 1.0
label: abtest决策流
metadata:
decision_flow:
- flow_node:
node_name: start_1
node_kind: start
next_node_name: abtest_1
next_node_kind: abtest
- flow_node:
node_name: abtest_1
node_kind: abtest
next_node_name:
next_node_kind:
- flow_node:
node_name: ruleset_1
node_kind: ruleset
next_node_name: end_1
next_node_kind: end
- flow_node:
node_name: ruleset_2
node_kind: ruleset
next_node_name: end_1
next_node_kind: end
- flow_node:
node_name: end_1
node_kind: end
next_node_name:
next_node_kind:
rulesets:
- ruleset:
info:
id: 1
name: ruleset_1
tag: internal
label: 规则集1
kind: ruleset
depends: [feature_1,feature_4]
exec_plan: parallel
block_strategy:
is_block: true
hit_rule: [rule_1] #命中该规则就中断
operator: EQ
value: reject #=reject中断
rules:
- rule:
id: 1
name: rule_1
tag: tag1
label: 规则1
conditions:
- condition:
name: c1
feature: feature_1
operator: GT
value: 50
decision:
depends: [c1]
logic: c1
output:
name: #rename 如果为空,则给rule.name赋值
value: reject
kind: string
assign:
feature_x: 111
- rule:
id: 2
name: rule_2
tag: tag2
label: 规则2
conditions:
- condition:
name: c2
feature: feature_1
operator: LT
value: 18
- condition:
name: c3
feature: feature_4
operator: GT
value: 50
decision:
depends: [c2, c3]
logic: c2 || c3
output:
name:
value: record
kind: string
assign:
- ruleset:
info:
id: 2
name: ruleset_2
tag: internal
label: 规则集2
kind: ruleset
depends: [feature_1,feature_3]
exec_plan: parallel
block_strategy:
is_block: true
hit_rule: [rule_3] #命中该规则就中断
operator: EQ
value: reject #命中规则优先级最高结果=reject 中断
rules:
- rule:
id: 44
name: rule_3
tag: rule_3
label: 规则3
conditions:
- condition:
name: c3
feature: feature_1
operator: GT
value: 5
decision:
depends: [c3]
logic: c3
output:
name:
value: record
kind: string
assign:
- rule:
id: 55
name: rule_4
tag: rule_4
label: 规则4
conditions:
- condition:
name: c4
feature: feature_3
operator: EQ
value: aaa
- condition:
name: c5
feature: feature_3
operator: EQ
value: bbb
decision:
depends: [c4, c5]
logic: c4 || c5
output:
name:
value: reject
kind: string
assign:
feat1: aa
feat2: bb
abtests:
- abtest:
info:
id: 11
name: abtest_1
tag: tag_ab
label: 分流实验
kind: abtest
depends:
branchs:
- branch:
name: branch_1
percent: 44.5
decision:
depends:
logic: random
output:
name:
value: ruleset_1
kind: ruleset
assign:
- branch:
name: branch_2
percent: 55.5
decision:
depends:
logic: random
output:
name:
value: ruleset_2
kind: ruleset
features:
- feature:
id: 1
name: feature_1
tag: aa
label: 特征1
kind: int
- feature:
id: 3
name: feature_3
tag: aa
label: 特征3
kind: string
- feature:
id: 4
name: feature_4
tag: aa
label: 特征4
kind: int