PHP Класс Vimeo\ABLincoln\Experiments\AbstractExperiment

Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$assignment
$in_experiment
$inputs
$logger_configured
$name
$salt

Открытые методы

Метод Описание
__construct ( mixed $inputs ) Set up attributes needed for experiment
__toString ( ) : string JSON representation of exposure log data - triggers exposure log
assign ( Assignment $params, array $inputs ) Add parameters used in experiment to current assignment
exposureLogged ( ) : boolean See whether the experiment has already been exposure logged
get ( string $name, string $default = null ) : the Get the value of a given experiment parameter - triggers exposure log
getParams ( ) : array Get all experiment parameters - triggers exposure log. In general, this should only be used by custom loggers
inExperiment ( ) : boolean In-experiment accessor
logEvent ( string $eventType, array $extras = null ) Log an arbitrary event
logExposure ( array $extras = null ) Logs exposure to treatment
name ( ) : string Experiment name accessor
salt ( ) : string Experiment-level salt accessor
setAutoExposureLogging ( boolean $value ) Disables / enables auto exposure logging (enabled by default)
setExposureLogged ( boolean $value ) Set whether the experiment has been exposure logged
setInExperiment ( boolean $value ) In-experiment setter
setName ( string $value ) Experiment name setter
setOverrides ( array $overrides ) Sets variables that are to remain fixed during execution. Note that setting this will overwrite inputs to the experiment
setSalt ( string $value ) Experiment-level salt setter
setup ( ) * Optionally set experiment attributes before run, e.g. name and salt

Защищенные методы

Метод Описание
_asBlob ( array $extras = [] ) : array Get an array representation of the experiment data
_configureLogger ( ) Set up files, database connections, sockets, etc for logging
_log ( array $data ) Log experiment data
_previouslyLogged ( ) : boolean Check if the input has already been logged. Gets called once in the constructor
_requiresExposureLogging ( ) Checks if experiment requires exposure logging, and if so exposure logs

Приватные методы

Метод Описание
_assignSetup ( ) Assignment and setup that happens when we need to log data
_requiresAssignment ( ) Checks if an assignment has been made, assigns one if not

Описание методов

__construct() публичный Метод

Set up attributes needed for experiment
public __construct ( mixed $inputs )
$inputs mixed input value or array to determine parameter assignments, e.g. userid

__toString() публичный Метод

JSON representation of exposure log data - triggers exposure log
public __toString ( ) : string
Результат string JSON representation of exposure log data

_asBlob() защищенный Метод

Get an array representation of the experiment data
protected _asBlob ( array $extras = [] ) : array
$extras array extra data to include in array
Результат array experiment data

_configureLogger() абстрактный защищенный Метод

Set up files, database connections, sockets, etc for logging
abstract protected _configureLogger ( )

_log() абстрактный защищенный Метод

Log experiment data
abstract protected _log ( array $data )
$data array data to log

_previouslyLogged() абстрактный защищенный Метод

Check if the input has already been logged. Gets called once in the constructor
abstract protected _previouslyLogged ( ) : boolean
Результат boolean true if previously logged, false otherwise

_requiresExposureLogging() защищенный Метод

Checks if experiment requires exposure logging, and if so exposure logs
protected _requiresExposureLogging ( )

assign() абстрактный публичный Метод

Add parameters used in experiment to current assignment
abstract public assign ( Assignment $params, array $inputs )
$params Vimeo\ABLincoln\Assignment assignment in which to place new parameters
$inputs array input data to determine parameter assignments

exposureLogged() публичный Метод

See whether the experiment has already been exposure logged
public exposureLogged ( ) : boolean
Результат boolean true if exposure logged, false otherwise

get() публичный Метод

Get the value of a given experiment parameter - triggers exposure log
public get ( string $name, string $default = null ) : the
$name string parameter to get the value of
$default string optional value to return if parameter undefined
Результат the value of the given parameter

getParams() публичный Метод

Get all experiment parameters - triggers exposure log. In general, this should only be used by custom loggers
public getParams ( ) : array
Результат array experiment parameters

inExperiment() публичный Метод

In-experiment accessor
public inExperiment ( ) : boolean
Результат boolean true if currently in experiment, false otherwise

logEvent() публичный Метод

Log an arbitrary event
public logEvent ( string $eventType, array $extras = null )
$eventType string name of event to log
$extras array optional extra data to include in log

logExposure() публичный Метод

Logs exposure to treatment
public logExposure ( array $extras = null )
$extras array optional extra data to include in exposure log

name() публичный Метод

Experiment name accessor
public name ( ) : string
Результат string the experiment name

salt() публичный Метод

Experiment-level salt accessor
public salt ( ) : string
Результат string the experiment-level salt

setAutoExposureLogging() публичный Метод

Disables / enables auto exposure logging (enabled by default)
public setAutoExposureLogging ( boolean $value )
$value boolean true to enable, false to disable

setExposureLogged() публичный Метод

Set whether the experiment has been exposure logged
public setExposureLogged ( boolean $value )
$value boolean true if exposure logged, false otherwise

setInExperiment() публичный Метод

In-experiment setter
public setInExperiment ( boolean $value )
$value boolean true if currently in experiment, false otherwise

setName() публичный Метод

Experiment name setter
public setName ( string $value )
$value string value to set the experiment name

setOverrides() публичный Метод

Sets variables that are to remain fixed during execution. Note that setting this will overwrite inputs to the experiment
public setOverrides ( array $overrides )
$overrides array parameter name/value pairs to use as overrides

setSalt() публичный Метод

Experiment-level salt setter
public setSalt ( string $value )
$value string value to set the experiment-level salt

setup() публичный Метод

* Optionally set experiment attributes before run, e.g. name and salt
public setup ( )

Описание свойств

$assignment защищенное свойство

protected $assignment

$in_experiment защищенное свойство

protected $in_experiment

$inputs защищенное свойство

protected $inputs

$logger_configured защищенное свойство

protected $logger_configured

$name защищенное свойство

protected $name

$salt защищенное свойство

protected $salt