userPonderationStrategy

Configures a UserPonderationStrategy for this feature with a decimal weight.

Unlike ponderationStrategy, this strategy is deterministic per user - the same user will always get the same result. Requires userId to be set in the com.yonatankarp.ff4k.core.FlippingExecutionContext.

Example

feature("beta-feature") {
userPonderationStrategy(0.1) // 10% of users will have access
}

Author

Yonatan Karp-Rudin

Parameters

weight

The probability (0.0 to 1.0) of users for whom the feature is enabled.

See also

for random (non-sticky) behavior

Throws

if weight is not in range 0.0..1.0


Configures a UserPonderationStrategy for this feature with an integer percentage.

Unlike ponderationStrategy, this strategy is deterministic per user - the same user will always get the same result. Requires userId to be set in the com.yonatankarp.ff4k.core.FlippingExecutionContext.

Example

feature("beta-feature") {
userPonderationStrategy(10) // 10% of users will have access
}

Author

Yonatan Karp-Rudin

Parameters

weight

The percentage (0 to 100) of users for whom the feature is enabled.

See also

for random (non-sticky) behavior

Throws

if weight is not in range 0..100