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
Geolocating existing log entries attribution task #7381
Conversation
…to geo-attribution-task Conflicts: misc/others/geoipUpdateRows.php plugins/UserCountry/Columns/Base.php
…thods. Remove PDO cursor and use segments query instead.
…thods. Remove PDO cursor and use segments query instead.
…to geo-attribution-task Conflicts: misc/others/geoipUpdateRows.php plugins/UserCountry/Columns/Base.php
Conflicts: misc/others/geoipUpdateRows.php
… documented as service).
…location created by fixture in DB, so command will re-attribute, and test API output of UserCountry reports to ensure accuracy. Made the test a System test. Also includes fix for IntegrationTestCase base type.
array($idVisit) | ||
) | ||
); | ||
} |
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.
A minor detail but why not turn that method into an update one:
protected function update($table, array $values, $idVisit)
{
return ...
}
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.
(which I think eventually insert/update/select methods should exist in the DBAL, like Doctrine DBAL does, but that's another topic :p)
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.
I could do this, this was left over from the old pull request; maybe I should review it again...
|
+1 maybe we can simply output a text like Also we'll need to update the FAQ https://piwik.org/faq/how-to/faq_167/ |
use Piwik\Common; | ||
use Piwik\Db; | ||
|
||
class RawLogUpdater |
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.
Wondering why you split RawLogFetcher and RawLogUpdater into two Classes and not into one? It looks like they belong together unless there is a good reason for it.
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.
That was marcin's decision, not sure what the reason behind it was. We could merge them together. Would you have an issue w/ the name RawLogDao
or RawLogDataDao
or RawLog(Data)Model
?
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.
I don't have an issue with names as long as they don't contain Data
or Info
:) Maybe the first or last one?
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.
Going the DAO way would be great (following standard names and patterns)
…cator instead of locationFetcher.
…o not use correct location provider).
If build passes, should be ready for another review and/or merge. |
} | ||
|
||
protected function processSpecifiedLogsInChunks(OutputInterface $output, $from, $to, $segmentLimit) | ||
{ |
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.
Maybe you can extract this into a class? Also maybe related methods like reattributeVisitLogs
? The name could be Something...Processor
? Most likely the related methods that are used there like reattributeVisitLogs
need to go into another class where they are public and testable. I do understand it is not as easy as you also want to output things in the middle but I'm sure there are solutions for this and if it is just an event.
…ailure due to QueuedTracking test that sets tracker database connection and starts transaction. Results in one LocalTracker call fail to add a visit in fixture for AttributeHistoricalDataWithLocationsTest, causing test to fail. Fixed by resetting static tracker DB connection in Fixture.php.
…ibute command and add tests to VisitorGeolocatorTest.
…tion test now. Also remove unused use statement in AttributeHistoricalDataWithLocations.php.
@mattab Feel free to take another look or merge. |
@diosmosis the build is failing with some rounding errors on MYSQLI: https://travis-ci.org/piwik/piwik/jobs/54514265 |
…olocator when determining visit fields to update.
@mattab Mysqli issues fixed. EDIT: UI test failure is random fail. |
please confirm when you have tested it on a real database to check that visits are geo located correctly. Once confirmed, 👍 for merging this! |
…made aware of configuration issues), move all verbose logging to VisitorGeolocator, change some arguments to options, add --force option to force even if location provider is not working.
Adding command to attribute or re-attribute existing visits w/ geolocated location info. Includes small refactor to location dimensions and new UserCountry service, VisitorGeolocator. Also includes new DAO class in Piwik core.
… a description to the command.
Updated version of this pull request: #6793
@piwik/core-team Ready for review.
@mattab Not sure what milestone to put this in?