pre-fill users and groups in createsim.php
This commit is contained in:
parent
d7f96307dc
commit
5b9062a518
|
@ -81,9 +81,8 @@ function newNotice($i, $tagmax)
|
||||||
$content = 'Test notice content';
|
$content = 'Test notice content';
|
||||||
|
|
||||||
if ($is_reply == 0) {
|
if ($is_reply == 0) {
|
||||||
common_set_user($user);
|
$stream = new InboxNoticeStream($user, $user->getProfile());
|
||||||
$stream = new InboxNoticeStream($user);
|
$notices = $stream->getNotices(0, 20);
|
||||||
$notices = $stream->getNotices(0, 20, null, null);
|
|
||||||
if ($notices->N > 0) {
|
if ($notices->N > 0) {
|
||||||
$nval = rand(0, $notices->N - 1);
|
$nval = rand(0, $notices->N - 1);
|
||||||
$notices->fetch(); // go to 0th
|
$notices->fetch(); // go to 0th
|
||||||
|
@ -212,16 +211,34 @@ function main($usercount, $groupcount, $noticeavg, $subsavg, $joinsavg, $tagmax)
|
||||||
global $config;
|
global $config;
|
||||||
$config['site']['dupelimit'] = -1;
|
$config['site']['dupelimit'] = -1;
|
||||||
|
|
||||||
$n = 1;
|
$n = 0;
|
||||||
$g = 1;
|
$g = 0;
|
||||||
|
|
||||||
newUser(0);
|
// Make users first
|
||||||
newGroup(0, $n);
|
|
||||||
|
$preuser = min($usercount, 5);
|
||||||
|
|
||||||
|
for ($j = 0; $j < $preuser; $j++) {
|
||||||
|
printfv("$i Creating user $n\n");
|
||||||
|
newUser($n);
|
||||||
|
$n++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$pregroup = min($groupcount, 3);
|
||||||
|
|
||||||
|
for ($k = 0; $k < $pregroup; $k++) {
|
||||||
|
printfv("$i Creating group $g\n");
|
||||||
|
newGroup($g, $n);
|
||||||
|
$g++;
|
||||||
|
}
|
||||||
|
|
||||||
// # registrations + # notices + # subs
|
// # registrations + # notices + # subs
|
||||||
|
|
||||||
$events = $usercount + $groupcount + ($usercount * ($noticeavg + $subsavg + $joinsavg));
|
$events = $usercount + $groupcount + ($usercount * ($noticeavg + $subsavg + $joinsavg));
|
||||||
|
|
||||||
|
$events -= $preuser;
|
||||||
|
$events -= $pregroup;
|
||||||
|
|
||||||
$ut = $usercount;
|
$ut = $usercount;
|
||||||
$gt = $ut + $groupcount;
|
$gt = $ut + $groupcount;
|
||||||
$nt = $gt + ($usercount * $noticeavg);
|
$nt = $gt + ($usercount * $noticeavg);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user