summaryrefslogtreecommitdiff
path: root/script/traffic_replay
diff options
context:
space:
mode:
authorTim Beale <timbeale@catalyst.net.nz>2018-11-27 13:50:32 +1300
committerAndrew Bartlett <abartlet@samba.org>2018-12-04 12:22:50 +0100
commit5517d60653b0aa25a354c3a35cbfb2aa89afb41a (patch)
tree8c6c73ac13abfa03a33a8221e22b71c6479ec44a /script/traffic_replay
parent13f57a7f80ea49830509e16b6fb8776962eba74f (diff)
downloadsamba-5517d60653b0aa25a354c3a35cbfb2aa89afb41a.tar.gz
traffic_replay: Add a max-members option to cap group size
traffic_replay tries to distribute the users among the groups in a realistic manner - some groups will have almost all users in them. However, this becomes a problem when testing a really large database, e.g. we may want 100K users, but no more than 5K users in each group. This patch adds a max-member option so we can limit how big the groups actually get. If we detect that a group exceeds the max-members, we reset the group's probability (of getting selected) to zero, and then recalculate the cumulative distribution. The means that the group should no longer get selected by generate_random_membership(). (Note we can't completely remove the group from the list because that changes the list-index-to-group-ID mapping). Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Dec 4 12:22:50 CET 2018 on sn-devel-144
Diffstat (limited to 'script/traffic_replay')
-rwxr-xr-xscript/traffic_replay4
1 files changed, 4 insertions, 0 deletions
diff --git a/script/traffic_replay b/script/traffic_replay
index 991c9a9eb03..0ee0f9b6575 100755
--- a/script/traffic_replay
+++ b/script/traffic_replay
@@ -112,6 +112,8 @@ def main():
user_gen_group.add_option('--group-memberships', type='int', default=0,
help='Total memberships to assign across all '
'test users and all groups')
+ user_gen_group.add_option('--max-members', type='int', default=None,
+ help='Max users to add to any one group')
parser.add_option_group(user_gen_group)
sambaopts = options.SambaOptions(parser)
@@ -333,6 +335,7 @@ def main():
opts.number_of_users,
opts.number_of_groups,
opts.group_memberships,
+ opts.max_members,
machine_accounts=computer_accounts,
traffic_accounts=False)
sys.exit()
@@ -346,6 +349,7 @@ def main():
number_of_users,
opts.number_of_groups,
opts.group_memberships,
+ opts.max_members,
machine_accounts=len(conversations),
traffic_accounts=True)