-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Improve Tracking API performance: track bulk page views as POST request #3134
Comments
This is needed quickly for faster log imports |
|
Attachment: Patch for this issue. |
I uploaded a patch for this issue. It provides bulk tracking & bulk API requests. Some notes on the patch:
What do you think of my patch? |
Sorry for the long delay in replying.
When bulk import is enabled, doTrack* should return "true" I think. Then we should test that the functions return true instead of not testing the output.
|
Attachment: New patch for this issue. |
I uploaded a new patch, let me know what you think. Replying to matt:
When posting JSON (and not a form-encoded string), $_POST won't be populated. My code will POST JSON so urls don't get encoded (which saves space).
connectDatabase will check if the DB connection is already created, and the DB is disconnected only after the loop. I've renamed the function to make this clearer.
Oops :)
Yes, that's right. And I'll do some benchmarks to see what the best # of requests to send are. |
I did some performance testing of my patch:
The number in the parentheses is the number of times I ran the test. I was pessimistic and used the longest elapsed time I encountered. The sweet spot seems to be around 400 requests. After that it stays pretty constant (I tried 10000 once and it was one request every .0113s. This was done going through localhost. I assume when tracking from a different machine, it would be faster just to send everything in one POST. |
capedfuzz: awesome, I'm eager to see how much faster the log import script will be. I'm also glad you chose to use JSON, it will make things easier. |
Benaka, beautiful patch, please commit, this is a significant improvement to the tracking API that Log Analytics users will enjoy a lot (since performance was the only negative feedback from the log import feature which MANY users like a lot!) |
(In [6524]) Fixes #3134, added bulk tracking feature and bulk request API method. Notes:
|
(In [6525]) Refs #3134, forgot to add expected output for getBulkRequest test. |
Thanks - could you please also send the documentation to add to: http://piwik.org/docs/tracking-api/reference/ to explain how to do bulk requests? There will be several users: mobile app piwik anynomous tracking, iOs SDK, Cyril with the Log Import script. A doc will be appreciated for sure :) |
(In [6551]) Refs #3134 Allowing POST to trigger bulk request + requiring authentication for bulk requests |
Thanks, doc is online at: bulk tracking API requests |
(In [6552]) Refs #3134 Fixing bug thanks Jenkins |
(In [6581]) Refs #3134, fixing build & make sure PiwikTracker throws when token auth not set and bulk track attempted. |
(In [6586]) Doing general reset checks Refs #3134 |
Hi capedfuzz, |
|
(In [Fix for "PHP Fatal error: ) operator not supported for strings in /var/www/piwik/libs/PiwikTracker/PiwikTracker.php on line 849" when php5-curl is not installed Refs #3134 |
Currently the tracking API accepts a set of GET parameters. each request is one page view. For performance reasons, it sometimes is desired to send multiple page views at once:
The changes to make are:
The text was updated successfully, but these errors were encountered: