Sandip
Sandip

Reputation: 347

How to divert percentage based traffic for AB Testing?

I have 2 services A and B. Based on configured percentage, I want to send the request to either A or B.

e.g. 30% of all my request should go to B and 70% should go to A.

What is the best way to implement this at a VM level

Upvotes: 0

Views: 165

Answers (1)

Sandip
Sandip

Reputation: 347

I implemented this using random number generator. Generate a random number between 1-100. If it lies between 1-30 then go B route else A route.

As it works on probability so does not guarantee split %

Upvotes: 1

Related Questions