Valve is a simple to integrate sampling and code flow control library, which can perform sampling on an unknown size of identifiers. It was developed to fullfill the need to perform percentage based roll out of a certain feature for users.
See the Wiki for java documentation and how to use.
Given a unique identifier and roll out percentage, decides weather to be sampled or not to be sampled.
You can configure Valve with all your features at the application start up, and dynamically enable or disable it during runtime.
Add below mentioned dependency to your pom.xml to install using Maven build automation tool.
<dependency>
<groupId>com.github.benefactor-org</groupId>
<artifactId>valve</artifactId>
<version>1.0.0</version>
</dependency>
You can perform sampling using any unique identifier. For instance using emailid of users you perform a percent feature roll out.
...
...
String email = user.getEmail(); // Unique identifier.
int percentEnabled = 25; // For how many percent of your user base should the new feature be enabled.
if(Valve.control(email, percentEnabled)) {
performNewLogin(user);
} else {
performOldLogin(user);
}
...
...
For bugs, questions and discussions please use the GitHub Issues.
Copyright 2020 Benefactor, Org.
Licensed under the GNU GENERAL PUBLIC LICENSE Version 3 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://github.com/benefactor-org/valve/blob/master/LICENCE
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.