Skip to content
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

Merged
merged 42 commits into from Mar 17, 2015

Conversation

diosmosis
Copy link
Member

Updated version of this pull request: #6793

@piwik/core-team Ready for review.

@mattab Not sure what milestone to put this in?

czolnowski and others added 22 commits October 17, 2014 16:39
…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
…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.
@diosmosis diosmosis added the Needs Review PRs that need a code review label Mar 7, 2015
array($idVisit)
)
);
}
Copy link
Contributor

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 ...
    }

Copy link
Contributor

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)

Copy link
Member Author

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...

@mnapoli
Copy link
Contributor

mnapoli commented Mar 8, 2015

misc/others/geoipUpdateRows.php was removed: are users using it and will they be confused?

@mattab
Copy link
Member

mattab commented Mar 8, 2015

misc/others/geoipUpdateRows.php was removed: are users using it and will they be confused?

+1 maybe we can simply output a text like the script was moved - please use this new command instead "./console ....

Also we'll need to update the FAQ https://piwik.org/faq/how-to/faq_167/

use Piwik\Common;
use Piwik\Db;

class RawLogUpdater
Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

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?

Copy link
Contributor

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)

@mattab mattab mentioned this pull request Mar 8, 2015
@diosmosis
Copy link
Member Author

If build passes, should be ready for another review and/or merge.

}

protected function processSpecifiedLogsInChunks(OutputInterface $output, $from, $to, $segmentLimit)
{
Copy link
Member

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.

diosmosis added 6 commits March 12, 2015 15:08
…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.
@diosmosis
Copy link
Member Author

@mattab Feel free to take another look or merge.

@mattab
Copy link
Member

mattab commented Mar 16, 2015

@diosmosis the build is failing with some rounding errors on MYSQLI: https://travis-ci.org/piwik/piwik/jobs/54514265

@diosmosis
Copy link
Member Author

@mattab Mysqli issues fixed.

EDIT: UI test failure is random fail.

@mattab
Copy link
Member

mattab commented Mar 17, 2015

please confirm when you have tested it on a real database to check that visits are geo located correctly.

Once confirmed, 👍 for merging this!

diosmosis added 2 commits March 17, 2015 09:48
…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.
diosmosis added a commit that referenced this pull request Mar 17, 2015
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.
@diosmosis diosmosis merged commit 00c3940 into master Mar 17, 2015
@diosmosis diosmosis deleted the geo-attribution-task branch March 17, 2015 19:54
@diosmosis diosmosis removed the Needs Review PRs that need a code review label Mar 17, 2015
@mattab mattab added the Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. label Mar 22, 2015
diosmosis pushed a commit that referenced this pull request Mar 22, 2015
@mattab mattab added the c: i18n For issues around internationalisation and localisation. label Oct 13, 2015
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Oct 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it. c: i18n For issues around internationalisation and localisation. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants