More stats to help troubleshoot rebalance
[MogileFS-Server.git] / t / util.t
blob76cf0df55221a227416dd81c928285a3156ba28b
1 #!/usr/bin/perl
3 use strict;
4 use warnings;
5 use Test::More;
6 use MogileFS::Util qw(weighted_list);
8 plan tests => 1;
10 my %first;
11 for (1..100) {
12 my @l = weighted_list(["A", 0.1], ["B", 0.3]);
13 $first{$l[0]}++;
16 # conservative when playing with randomness
17 ok($first{"B"} >= ($first{"A"} * 1.8), "weightest list");