changeset 1752:b4de612feff8

Documented the split_clients module in stream.
author Yaroslav Zhuravlev <yar@nginx.com>
date Thu, 14 Jul 2016 20:33:18 +0300
parents 3768eb3d9c6c
children 256774f145ac
files xml/en/GNUmakefile xml/en/docs/index.xml xml/en/docs/stream/ngx_stream_split_clients_module.xml xml/ru/GNUmakefile xml/ru/docs/index.xml xml/ru/docs/stream/ngx_stream_split_clients_module.xml
diffstat 6 files changed, 156 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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			\
 
--- 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 @@
 <article name="nginx documentation"
          link="/en/docs/"
          lang="en"
-         rev="28"
+         rev="29"
          toc="no">
 
 
@@ -522,6 +522,11 @@
 </listitem>
 
 <listitem>
+<link doc="stream/ngx_stream_split_clients_module.xml">
+ngx_stream_split_clients_module</link>
+</listitem>
+
+<listitem>
 <link doc="stream/ngx_stream_ssl_module.xml">
 ngx_stream_ssl_module</link>
 </listitem>
--- /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 @@
+<?xml version="1.0"?>
+
+<!--
+  Copyright (C) Nginx, Inc.
+  -->
+
+<!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
+
+<module name="Module ngx_stream_split_clients_module"
+        link="/en/docs/stream/ngx_stream_split_clients_module.html"
+        lang="en"
+        rev="1">
+
+<section id="summary">
+
+<para>
+The <literal>ngx_stream_split_clients_module</literal> module (1.11.3) creates
+variables suitable for A/B testing, also known as split testing.
+</para>
+
+</section>
+
+
+<section id="example" name="Example Configuration">
+
+<para>
+<example>
+stream {
+    split_clients "${remote_addr}AAA" $variant {
+                   0.5%               .one;
+                   2.0%               .two;
+                   *                  "";
+    }
+</example>
+</para>
+
+</section>
+
+
+<section id="directives" name="Directives">
+
+<directive name="split_clients">
+<syntax block="yes">
+    <value>string</value>
+    <value>$variable</value></syntax>
+<default/>
+<context>stream</context>
+
+<para>
+Creates a variable for A/B testing, for example:
+<example>
+split_clients "${remote_addr}AAA" $variant {
+               0.5%               .one;
+               2.0%               .two;
+               *                  "";
+}
+</example>
+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 <literal>".one"</literal> of the <var>$variant</var> variable,
+hash values from 21474836 to 107374180 (2%) correspond to
+the value <literal>".two"</literal>,
+and hash values from 107374181 to 4294967295 correspond to
+the value <literal>""</literal> (an empty string).
+</para>
+
+</directive>
+
+</section>
+
+</module>
--- 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			\
 
--- 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 @@
 <article name="nginx: документация"
          link="/ru/docs/"
          lang="ru"
-         rev="28"
+         rev="29"
          toc="no">
 
 
@@ -526,6 +526,11 @@
 </listitem>
 
 <listitem>
+<link doc="stream/ngx_stream_split_clients_module.xml">
+ngx_stream_split_clients_module</link>
+</listitem>
+
+<listitem>
 <link doc="stream/ngx_stream_ssl_module.xml">
 ngx_stream_ssl_module</link>
 </listitem>
--- /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 @@
+<?xml version="1.0"?>
+
+<!--
+  Copyright (C) Nginx, Inc.
+  -->
+
+<!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
+
+<module name="Модуль ngx_stream_split_clients_module"
+        link="/ru/docs/stream/ngx_stream_split_clients_module.html"
+        lang="ru"
+        rev="1">
+
+<section id="summary">
+
+<para>
+Модуль <literal>ngx_stream_split_clients_module</literal> (1.11.3) создаёт
+переменные для A/B тестирования (также известного как “split-тестирование”).
+</para>
+
+</section>
+
+
+<section id="example" name="Пример конфигурации">
+
+<para>
+<example>
+stream {
+    split_clients "${remote_addr}AAA" $variant {
+                   0.5%               .one;
+                   2.0%               .two;
+                   *                  "";
+    }
+</example>
+</para>
+
+</section>
+
+
+<section id="directives" name="Директивы">
+
+<directive name="split_clients">
+<syntax block="yes">
+    <value>строка</value>
+    <value>$переменная</value></syntax>
+<default/>
+<context>stream</context>
+
+<para>
+Создаёт переменную для A/B тестирования, например:
+<example>
+split_clients "${remote_addr}AAA" $variant {
+               0.5%               .one;
+               2.0%               .two;
+               *                  "";
+}
+</example>
+Значение исходной строки хэшируется с помощью MurmurHash2.
+В приведённом примере при значениях хэша от 0 до 21474835 (0.5%)
+переменная <var>$variant</var> получит значение <literal>".one"</literal>.
+При значениях хэша от 21474836 до 107374180 (2%) — <literal>".two"</literal>.
+И при значениях хэша от 107374181 до 4294967295 — <literal>""</literal>
+(пустая строка).
+</para>
+
+</directive>
+
+</section>
+
+</module>