|
FastMM C++ API 0.14.0
Public headers, tier 1 and tier 2
|
#include <fastmm/strategies/ab_test.hpp>
Public Types | |
| enum class | State : std::uint8_t { Waiting , Running , Ended } |
| using | ParamValue = ParamPublisher::ParamValue |
Public Member Functions | |
| AbController (AbPlan plan, ParamPublisher &publisher) | |
publisher's values now are the configured parameters each arm starts from; it must outlive the controller. | |
| const AbPlan & | plan () const noexcept |
| bool | poll (Timestamp now) |
Publishes the parameters of each instrument whose arm differs at now from the one it was last put in, one update for every instrument when they all move to the same arm. | |
| Timestamp | next_change (Timestamp now) const noexcept |
The next time poll() has something to do after now; Timestamp::max() once ended. | |
| void | stop (int promote=AbPlan::kNoArm) noexcept |
Ends the test at the next poll(): every instrument leaves its arm and gets the configured parameters, or with promote the parameters of that arm. | |
| State | state (Timestamp now) const noexcept |
| int | promoted () const noexcept |
| int | arm (std::string_view name) const noexcept |
| The arm's index by name, kNoArm when none has it. | |
| bool | owns (std::string_view param) const noexcept |
| A parameter some arm names: the test sets it while it runs. | |
| const std::vector< ParamValue > & | values (int arm) const |
| The values an arm's update carries (kNoArm: the configured ones), in name order. | |
| int | current (std::size_t inst) const noexcept |
| The arm the instrument was last put in, kNoArm when none. | |
| std::uint64_t | refused () const noexcept |
| Updates the publisher refused when they were published (a validate() that no longer holds for an instrument's parameters), and the last reason. | |
| const std::string & | last_error () const noexcept |
| std::string | status (Timestamp now) const |
| fastmm-ctl ab: the test on the first line, then one line per topic: its arms, the block and end, and each instrument's arm. | |
|
strong |
| fastmm::AbController::AbController | ( | AbPlan | plan, |
| ParamPublisher & | publisher | ||
| ) |
publisher's values now are the configured parameters each arm starts from; it must outlive the controller.
Throws std::invalid_argument when an arm names a parameter the strategy does not have or a value its schema or validate() refuses, or when the plan splits the instruments and the strategy keeps one parameter set (ParamScope::Shared).
|
inlinenoexcept |
| bool fastmm::AbController::poll | ( | Timestamp | now | ) |
Publishes the parameters of each instrument whose arm differs at now from the one it was last put in, one update for every instrument when they all move to the same arm.
False when the sink refused one: the instruments not yet moved are moved by the next call.
The next time poll() has something to do after now; Timestamp::max() once ended.
|
noexcept |
Ends the test at the next poll(): every instrument leaves its arm and gets the configured parameters, or with promote the parameters of that arm.
Later polls do nothing.
|
inlinenoexcept |
|
noexcept |
The arm's index by name, kNoArm when none has it.
|
noexcept |
A parameter some arm names: the test sets it while it runs.
| const std::vector< ParamValue > & fastmm::AbController::values | ( | int | arm | ) | const |
The values an arm's update carries (kNoArm: the configured ones), in name order.
|
inlinenoexcept |
The arm the instrument was last put in, kNoArm when none.
|
inlinenoexcept |
Updates the publisher refused when they were published (a validate() that no longer holds for an instrument's parameters), and the last reason.
|
inlinenoexcept |
| std::string fastmm::AbController::status | ( | Timestamp | now | ) | const |
fastmm-ctl ab: the test on the first line, then one line per topic: its arms, the block and end, and each instrument's arm.