Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Add sample logic to users from a feature #12

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

rafaeldev
Copy link

The idea of this PR is to supply a demand that emerged from this issue. => https://github.com/wirecardBrasil/jcurtain/issues/3

To resolve the idea of "get a sample for a given population of user" we create new keys for know:

  • Percentage which will be extracted from total mass (feature:feature:users:session:percentage);
  • List of users extrated and calculateds (feature:feature:users:session:sample);
  • Time to leave in days for delete user extracted list (feature:feature:users:session:ttl_in_days);

We used the namespace session on keys to give idea which these lists will be removed in any some.

Thanks for @eiguike for support

def get_users_sample(feature)
users = get_feature_sample(feature).users

return users unless users.empty?
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If users sample was calculated before, return this list

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant