Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Setting Throttle percentage in website

 
Sunil Anna
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was not sure in which forum to place this question. So placed it in general java

I am working on a website. I've a requirement that says showing a newly added feature to a specidifed number of users.
Say 50%. So, if currently total userbase is 10,000 show this new feature to 5,000 people only. I want to achieve this programmatically.
How can I do that

I'm using
Java
Spring Web-Flow
and
Weblogic

Just a basic idea would suffice. Let me know if you need anyother info

Thanks
 
Sunil Anna
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Trying my luck again

 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Something like this may work:
 
Sunil Anna
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Lester for your reply.

But what if I need to do the same for 27% or 35% users
userID certainly wouldn't work in this case.
Actually, I need to make this percentage configurable.
 
Jan Hoppmann
Ranch Hand
Posts: 147
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take the size of the whole userbase and check if the ID of the current user is in the first 27% (or 35%, or whatever you want). So only older users would be shown the new feature, of course. You could also check if the user ID is in the last n% (where n is your desired percentage). So only newer users would be able to use it. This is a quite simple approach, of course. I'm assuming you can't set a flag in the user itself.
 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For N% you could use

if ((userID % 100) < N)

(assuming that userIDs are uniformly distributed, of course)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic