# HG changeset patch # User Yaroslav Zhuravlev # Date 1468517598 -10800 # Node ID b4de612feff8bfbd31f746d44d476cc21dde8abf # Parent 3768eb3d9c6ce53d088f36541c6342d5afd3df1b Documented the split_clients module in stream. diff -r 3768eb3d9c6c -r b4de612feff8 xml/en/GNUmakefile --- a/xml/en/GNUmakefile Thu Jul 14 20:33:05 2016 +0300 +++ b/xml/en/GNUmakefile Thu Jul 14 20:33:18 2016 +0300 @@ -102,6 +102,7 @@ stream/ngx_stream_map_module \ stream/ngx_stream_proxy_module \ stream/ngx_stream_return_module \ + stream/ngx_stream_split_clients_module \ stream/ngx_stream_ssl_module \ stream/ngx_stream_upstream_module \ diff -r 3768eb3d9c6c -r b4de612feff8 xml/en/docs/index.xml --- a/xml/en/docs/index.xml Thu Jul 14 20:33:05 2016 +0300 +++ b/xml/en/docs/index.xml Thu Jul 14 20:33:18 2016 +0300 @@ -8,7 +8,7 @@
@@ -522,6 +522,11 @@ + +ngx_stream_split_clients_module + + + ngx_stream_ssl_module diff -r 3768eb3d9c6c -r b4de612feff8 xml/en/docs/stream/ngx_stream_split_clients_module.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xml/en/docs/stream/ngx_stream_split_clients_module.xml Thu Jul 14 20:33:18 2016 +0300 @@ -0,0 +1,72 @@ + + + + + + + + +
+ + +The ngx_stream_split_clients_module module (1.11.3) creates +variables suitable for A/B testing, also known as split testing. + + +
+ + +
+ + + +stream { + split_clients "${remote_addr}AAA" $variant { + 0.5% .one; + 2.0% .two; + * ""; + } + + + +
+ + +
+ + + + string + $variable + +stream + + +Creates a variable for A/B testing, for example: + +split_clients "${remote_addr}AAA" $variant { + 0.5% .one; + 2.0% .two; + * ""; +} + +The value of the original string is hashed using MurmurHash2. +In the example given, hash values from 0 to 21474835 (0.5%) +correspond to the +value ".one" of the $variant variable, +hash values from 21474836 to 107374180 (2%) correspond to +the value ".two", +and hash values from 107374181 to 4294967295 correspond to +the value "" (an empty string). + + + + +
+ +
diff -r 3768eb3d9c6c -r b4de612feff8 xml/ru/GNUmakefile --- a/xml/ru/GNUmakefile Thu Jul 14 20:33:05 2016 +0300 +++ b/xml/ru/GNUmakefile Thu Jul 14 20:33:18 2016 +0300 @@ -91,6 +91,7 @@ stream/ngx_stream_map_module \ stream/ngx_stream_proxy_module \ stream/ngx_stream_return_module \ + stream/ngx_stream_split_clients_module \ stream/ngx_stream_ssl_module \ stream/ngx_stream_upstream_module \ diff -r 3768eb3d9c6c -r b4de612feff8 xml/ru/docs/index.xml --- a/xml/ru/docs/index.xml Thu Jul 14 20:33:05 2016 +0300 +++ b/xml/ru/docs/index.xml Thu Jul 14 20:33:18 2016 +0300 @@ -8,7 +8,7 @@
@@ -526,6 +526,11 @@ + +ngx_stream_split_clients_module + + + ngx_stream_ssl_module diff -r 3768eb3d9c6c -r b4de612feff8 xml/ru/docs/stream/ngx_stream_split_clients_module.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xml/ru/docs/stream/ngx_stream_split_clients_module.xml Thu Jul 14 20:33:18 2016 +0300 @@ -0,0 +1,70 @@ + + + + + + + + +
+ + +Модуль ngx_stream_split_clients_module (1.11.3) создаёт +переменные для A/B тестирования (также известного как “split-тестирование”). + + +
+ + +
+ + + +stream { + split_clients "${remote_addr}AAA" $variant { + 0.5% .one; + 2.0% .two; + * ""; + } + + + +
+ + +
+ + + + строка + $переменная + +stream + + +Создаёт переменную для A/B тестирования, например: + +split_clients "${remote_addr}AAA" $variant { + 0.5% .one; + 2.0% .two; + * ""; +} + +Значение исходной строки хэшируется с помощью MurmurHash2. +В приведённом примере при значениях хэша от 0 до 21474835 (0.5%) +переменная $variant получит значение ".one". +При значениях хэша от 21474836 до 107374180 (2%) — ".two". +И при значениях хэша от 107374181 до 4294967295 — "" +(пустая строка). + + + + +
+ +