-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm trying to develop an ab-test plugin, how to implement it? #841
Comments
You can make a try with this way: curl -i http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT -d '
{
"uri": "/index.html",
"filter_func": "function(vars) return vars.arg_id and (vars.arg_id % 7 <= 4) end",
"plugins": {
"redirect": {
"uri": "/test?group_id=234"
}
},
"upstream": {
"type": "roundrobin",
"nodes": {
"39.97.63.215:80": 1
}
}
}'
curl -i http://127.0.0.1:9080/apisix/admin/routes/2 -X PUT -d '
{
"uri": "/index.html",
"filter_func": "function(vars) return vars.arg_id and (vars.arg_id % 7 > 4) end",
"plugins": {
"redirect": {
"uri": "/test?group_id=83838"
}
},
"upstream": {
"type": "roundrobin",
"nodes": {
"39.97.63.215:80": 1
}
}
}' |
Better way: we can support more operator like Here is the operator list of current: It may be like this:
|
This way basically can solve my problem and is graceful. I will think about it. |
feel happy to help you. |
i think we should implement a rule engine .we can compute by the express. like >, <, mod etc. |
how about this way? |
we can add doc and examples for the powerful route |
i like this, but is the support limited? |
it means: |
I think we should write this into doc. |
This is still a todo thing. |
Hi, I'm trying to develop an ab-test plugin and it will be used for the backend API's URI or params control. The configuration below is my simple design. I'm not sure whether it is a generic feature. Looking forward to your suggestion.
The text was updated successfully, but these errors were encountered: