⚠ Do not install this module on a production environment!
This HumHub module can be used to emulate an active HumHub network with a certain amount of users, spaces and content. This module uses yii faker library in order to generate partly random test data.
- https://github.com/yiisoft/yii2-faker/blob/master/docs/guide/basic-usage.md
- https://github.com/fzaninotto/Faker#fakerproviderdatetime
You can furthermore use this module for profiling purposes.
- First user with id 1 is always in admin group with name
root
- Other usernames are of format User, so user with id 2 has username User1
- All user passwords are
test
- By default 2000 Users will be created
- Space names are random
- Users will be spread in steps of 100 through the first spaces
- By default 2000 Spaces will be created
- This module will generate post and related content created activities
- The content is spread through the first few spaces and profile of user1
- By default 80000 content entries will be created (50/50 Activity/Post)
- By default User 1 has 1000 followers
- By default the first few spaces
- By default User 1 has 1000 friends
Generate all:
php yii profiler/fixture/generate-all
Generate specific fixture:
php yii profiler/fixture/generate content/content
⚠ This will overwrite existing data in your database!
Load all:
php yii profiler/fixture/load "*"
Note: The execution of this command may take some time...
Load specific fixture:
php yii profiler/fixture/load "Content"
Its recommend to set SET GLOBAL query_cache_size = 0;
in your test mysql db in order to test against
non cached query times.
SHOW VARIABLES LIKE 'query_cache_size';
should return a value of 0
.
Run stream profiler with default run count:
php yii profiler/stream/run
Set run count:
php yii profiler/stream/run --count=200
- https://github.com/yiisoft/yii2-faker/blob/master/docs/guide/basic-usage.md
- https://github.com/fzaninotto/Faker#fakerproviderdatetime
class MyProfilerController extends ProfileController
{
public function actionRun()
{
$result = $this->runProfiler(function(ProfilerResult $result) {
// DO SOME WORK YOU WANT TO PROFILE
}, $this->title);
$this->printResult($result);
}
}