comparison xml/en/docs/stream/ngx_stream_split_clients_module.xml @ 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 xml/en/docs/http/ngx_http_split_clients_module.xml@95c3c3bbf1ce
children 42d2806f5b28
comparison
equal deleted inserted replaced
1751:3768eb3d9c6c 1752:b4de612feff8
1 <?xml version="1.0"?>
2
3 <!--
4 Copyright (C) Nginx, Inc.
5 -->
6
7 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
8
9 <module name="Module ngx_stream_split_clients_module"
10 link="/en/docs/stream/ngx_stream_split_clients_module.html"
11 lang="en"
12 rev="1">
13
14 <section id="summary">
15
16 <para>
17 The <literal>ngx_stream_split_clients_module</literal> module (1.11.3) creates
18 variables suitable for A/B testing, also known as split testing.
19 </para>
20
21 </section>
22
23
24 <section id="example" name="Example Configuration">
25
26 <para>
27 <example>
28 stream {
29 split_clients "${remote_addr}AAA" $variant {
30 0.5% .one;
31 2.0% .two;
32 * "";
33 }
34 </example>
35 </para>
36
37 </section>
38
39
40 <section id="directives" name="Directives">
41
42 <directive name="split_clients">
43 <syntax block="yes">
44 <value>string</value>
45 <value>$variable</value></syntax>
46 <default/>
47 <context>stream</context>
48
49 <para>
50 Creates a variable for A/B testing, for example:
51 <example>
52 split_clients "${remote_addr}AAA" $variant {
53 0.5% .one;
54 2.0% .two;
55 * "";
56 }
57 </example>
58 The value of the original string is hashed using MurmurHash2.
59 In the example given, hash values from 0 to 21474835 (0.5%)
60 correspond to the
61 value <literal>".one"</literal> of the <var>$variant</var> variable,
62 hash values from 21474836 to 107374180 (2%) correspond to
63 the value <literal>".two"</literal>,
64 and hash values from 107374181 to 4294967295 correspond to
65 the value <literal>""</literal> (an empty string).
66 </para>
67
68 </directive>
69
70 </section>
71
72 </module>