-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add direct database insertion option for fast visit generation #139
Conversation
Added support for multiple threads using the Symphony\Process component, which this PR adds to the plugin composer dependencies. This is only used when the |
Nice work! There's somehow more to it than I envisaged 🙈 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bx80 Since we are not prefixing the tables, getting below errors
In GenerateVisitsDb.php line 495:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'matomo_local.log
_action' doesn't exist
…ker component instead of using separate random arrays
@bx80 Left comments on slack thread regarding warnings being received, when there is no goal also when there is 1 goal. |
… int return for random visit count
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bx80 functional testing now works as expected
./console visitorgenerator:generate-visits-db --idsite 4 --limit-visits=200 --days=3 --threads=8
8 threads requested
Starting threads........ [8 threads were started]
........................
Site Id 4
Time taken 3.03s
Visits generated 192
Visits actions generated 842
Actions generated 842
Conversions generated 6
Visits per second 63 / sec
Queries per second 621 / sec
Thanks for the review @AltamashShaikh 👍 If there is no more review feedback, can someone in @matomo-org/plugin-reviewers merge this? (I don't have access). |
Description:
This PR adds a new console command to the visitor generator which will directly insert fake visits into the database without using the tracker API.
This is intended for quickly creating large datasets where speed of data generation is more important than a perfect simulation of tracking requests.
Usage:
Unoptimized performance on basic hardware is currently 350 - 700 visits per second (~2,500 insert/s) compared to ~7 visits per second for visits generated using the normal tracker API method.
Fixes #138
Review