Rocking by percentage? [closed]

0

Good afternoon Dear,

The problem itself is not coding but rather to define a process well and then codify it.

I have the present situation, I must refer or delegate tasks to x or and webService according to a defined percentage. Example:

Send 80% of the requests to the webService "X" and 20% to the webService "Y" that percentage must be configurable, but it is not what is bothering me at this moment. I do not know how to proceed to optimize this "Balancing".

I plan to specify a minimum threshold of example 10 requests and then start counting 8 requests for "X" and 2 requests for "Y" or the opposite to cover first the lowest percentage and then the highest percentage.

As they recommend me to perform this type of balancing.

Thank you very much in advance.

    
asked by Ivan Fontalvo 29.10.2018 в 23:17
source

1 answer

1

The problem, for me, is that if the decision you make in the program that makes the calls you will not have the number of requests that were made to decide who to call.

For this I would use a random value between 0 and 1, if the value is less than .8 send the request to the service x, if it is greater than or equal to .8 send the service and.

This form of "balancing" we use it in several places of our codes and, in everything, they work well.

I hope it serves you.

Good luck!

    
answered by 29.10.2018 / 23:39
source