krak / ab
A/B 测试库
v0.1.0
2016-12-19 04:44 UTC
Requires
- lastguest/murmurhash: ^1.3
Requires (Dev)
- fool/echolog: ^1.0
- peridot-php/peridot: ^1.18
This package is auto-updated.
Last update: 2024-09-18 17:53:08 UTC
README
Krak\AB
是一个实现 A/B 测试的框架。
安装
使用 composer 在 krak/ab
下安装
使用方法
<?php use Krak\AB; $exp = AB\Experiment::create('flow', [ // first is the variant name, second is the ratio. ['standard', 80], ['variant', 20], ]); $engine = AB\engine([$exp], new Logger()); // any PSR Logger will work // The default engine is the Hashing engine foreach (range(1, 10) as $i) { // echo $engine->activate('flow', 'id_'.$i.rand()) . PHP_EOL; }