{"action":"created","comment":{"url":"https://api.github.com/repos/Wikia/app/pulls/comments/28383841","id":28383841,"diff_hunk":"@@ -349,4 +362,16 @@ public function mergeUsersEditsData( array &$aUsersEditsData, array $aUserEditsD\n \t\t}\n \t}\n \n+\t/**\n+\t * Extracts list of users ids from provided $aUsersData\n+\t * @param $aUsersData array of users data arrays consistent with structure of ExactTargetUserHooksHelper::prepareUserParams\n+\t * @return array\n+\t */\n+\tpublic function prepareUserIds( $aUsersData ) {\n+\t\tforeach( $aUsersData as $aUserData ) {\n+\t\t\t$aUserIds[] = $aUserData['user_id'];\n+\t\t}","path":"extensions/wikia/ExactTargetUpdates/tasks/ExactTargetUserTaskHelper.php","position":73,"original_position":73,"commit_id":"041b706c84d271f2cf207f027ca10f25e4f16f60","original_commit_id":"041b706c84d271f2cf207f027ca10f25e4f16f60","user":{"login":"Grunny","id":230630,"avatar_url":"https://avatars.githubusercontent.com/u/230630?v=3","gravatar_id":"","url":"https://api.github.com/users/Grunny","html_url":"https://github.com/Grunny","followers_url":"https://api.github.com/users/Grunny/followers","following_url":"https://api.github.com/users/Grunny/following{/other_user}","gists_url":"https://api.github.com/users/Grunny/gists{/gist_id}","starred_url":"https://api.github.com/users/Grunny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Grunny/subscriptions","organizations_url":"https://api.github.com/users/Grunny/orgs","repos_url":"https://api.github.com/users/Grunny/repos","events_url":"https://api.github.com/users/Grunny/events{/privacy}","received_events_url":"https://api.github.com/users/Grunny/received_events","type":"User","site_admin":false},"body":"If you want to use a new builtin method we got with the upgrade from PHP 5.4 to 5.6, [`array_column`](http://php.net/manual/en/function.array-column.php) will do this in one line: `array_column( $aUserData, 'user_id' );`","created_at":"2015-04-15T00:09:10Z","updated_at":"2015-04-15T00:09:10Z","html_url":"https://github.com/Wikia/app/pull/6931#discussion_r28383841","pull_request_url":"https://api.github.com/repos/Wikia/app/pulls/6931","_links":{"self":{"href":"https://api.github.com/repos/Wikia/app/pulls/comments/28383841"},"html":{"href":"https://github.com/Wikia/app/pull/6931#discussion_r28383841"},"pull_request":{"href":"https://api.github.com/repos/Wikia/app/pulls/6931"}}},"pull_request":{"url":"https://api.github.com/repos/Wikia/app/pulls/6931","id":33222394,"html_url":"https://github.com/Wikia/app/pull/6931","diff_url":"https://github.com/Wikia/app/pull/6931.diff","patch_url":"https://github.com/Wikia/app/pull/6931.patch","issue_url":"https://api.github.com/repos/Wikia/app/issues/6931","number":6931,"state":"open","locked":false,"title":"Ce 1543 fix editcount et updates","user":{"login":"kamilkoterba","id":2316139,"avatar_url":"https://avatars.githubusercontent.com/u/2316139?v=3","gravatar_id":"","url":"https://api.github.com/users/kamilkoterba","html_url":"https://github.com/kamilkoterba","followers_url":"https://api.github.com/users/kamilkoterba/followers","following_url":"https://api.github.com/users/kamilkoterba/following{/other_user}","gists_url":"https://api.github.com/users/kamilkoterba/gists{/gist_id}","starred_url":"https://api.github.com/users/kamilkoterba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kamilkoterba/subscriptions","organizations_url":"https://api.github.com/users/kamilkoterba/orgs","repos_url":"https://api.github.com/users/kamilkoterba/repos","events_url":"https://api.github.com/users/kamilkoterba/events{/privacy}","received_events_url":"https://api.github.com/users/kamilkoterba/received_events","type":"User","site_admin":false},"body":"https://wikia-inc.atlassian.net/browse/CE-1543\r\n\r\nPreviously user record was updated in ExactTarget after each ArticleSaveComplete. Some inconsistencies in editcount user number updates found. Decided to change approach and update numbers once a day based on list of users that edited previous day. (same as it's done for incremental user per wiki daily updates)\r\n\r\nThis way we gain data consistency and reduce number of updates.\r\nAssume 4k users edited 3 times each. It was causing 12k updates. Now it will be two updates one with 2.5k users and second with remaining 1.5k (chunk limit 2.5k)\r\n\r\n@SQLReview \r\n```\r\nSELECT DISTINCT user_id\r\n\t FROM rollup_wiki_user_events\r\n\t WHERE time_id > '2015-04-13 02:47:26'\r\n\t AND period_id = '1'\r\n\t AND user_id <> '0'\r\n```\r\ntime_id is always set to be greater than day before\r\n\r\nEXPLAIN\r\n```\r\n          id: 1\r\n  select_type: SIMPLE\r\n        table: rollup_wiki_user_events\r\n         type: range\r\npossible_keys: PRIMARY,time_id\r\n          key: PRIMARY\r\n      key_len: 8\r\n          ref: NULL\r\n         rows: 67732\r\n        Extra: Using where; Using index; Using temporary\r\n```\r\n\r\n@Wikia/community-engineering ","created_at":"2015-04-14T02:49:58Z","updated_at":"2015-04-15T00:09:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9117b3a15e527543a5aeecf41752cddbca988cdc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Wikia/app/pulls/6931/commits","review_comments_url":"https://api.github.com/repos/Wikia/app/pulls/6931/comments","review_comment_url":"https://api.github.com/repos/Wikia/app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Wikia/app/issues/6931/comments","statuses_url":"https://api.github.com/repos/Wikia/app/statuses/041b706c84d271f2cf207f027ca10f25e4f16f60","head":{"label":"Wikia:CE-1543-fix-editcount-et-updates","ref":"CE-1543-fix-editcount-et-updates","sha":"041b706c84d271f2cf207f027ca10f25e4f16f60","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":5532313,"name":"app","full_name":"Wikia/app","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/app","description":"Wikia Application Code","fork":false,"url":"https://api.github.com/repos/Wikia/app","forks_url":"https://api.github.com/repos/Wikia/app/forks","keys_url":"https://api.github.com/repos/Wikia/app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/app/teams","hooks_url":"https://api.github.com/repos/Wikia/app/hooks","issue_events_url":"https://api.github.com/repos/Wikia/app/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/app/events","assignees_url":"https://api.github.com/repos/Wikia/app/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/app/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/app/tags","blobs_url":"https://api.github.com/repos/Wikia/app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/app/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/app/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/app/languages","stargazers_url":"https://api.github.com/repos/Wikia/app/stargazers","contributors_url":"https://api.github.com/repos/Wikia/app/contributors","subscribers_url":"https://api.github.com/repos/Wikia/app/subscribers","subscription_url":"https://api.github.com/repos/Wikia/app/subscription","commits_url":"https://api.github.com/repos/Wikia/app/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/app/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/app/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/app/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/app/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/app/merges","archive_url":"https://api.github.com/repos/Wikia/app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/app/downloads","issues_url":"https://api.github.com/repos/Wikia/app/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/app/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/app/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/app/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/app/releases{/id}","created_at":"2012-08-23T20:55:58Z","updated_at":"2015-04-14T23:36:31Z","pushed_at":"2015-04-14T23:38:27Z","git_url":"git://github.com/Wikia/app.git","ssh_url":"git@github.com:Wikia/app.git","clone_url":"https://github.com/Wikia/app.git","svn_url":"https://github.com/Wikia/app","homepage":"http://dev.wikia.com","size":1390626,"stargazers_count":76,"watchers_count":76,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":57,"mirror_url":null,"open_issues_count":59,"forks":57,"open_issues":59,"watchers":76,"default_branch":"dev"}},"base":{"label":"Wikia:dev","ref":"dev","sha":"95ca4a6defa1f67feb033c4cf488cb41602e7fa7","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":5532313,"name":"app","full_name":"Wikia/app","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/app","description":"Wikia Application Code","fork":false,"url":"https://api.github.com/repos/Wikia/app","forks_url":"https://api.github.com/repos/Wikia/app/forks","keys_url":"https://api.github.com/repos/Wikia/app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/app/teams","hooks_url":"https://api.github.com/repos/Wikia/app/hooks","issue_events_url":"https://api.github.com/repos/Wikia/app/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/app/events","assignees_url":"https://api.github.com/repos/Wikia/app/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/app/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/app/tags","blobs_url":"https://api.github.com/repos/Wikia/app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/app/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/app/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/app/languages","stargazers_url":"https://api.github.com/repos/Wikia/app/stargazers","contributors_url":"https://api.github.com/repos/Wikia/app/contributors","subscribers_url":"https://api.github.com/repos/Wikia/app/subscribers","subscription_url":"https://api.github.com/repos/Wikia/app/subscription","commits_url":"https://api.github.com/repos/Wikia/app/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/app/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/app/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/app/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/app/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/app/merges","archive_url":"https://api.github.com/repos/Wikia/app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/app/downloads","issues_url":"https://api.github.com/repos/Wikia/app/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/app/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/app/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/app/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/app/releases{/id}","created_at":"2012-08-23T20:55:58Z","updated_at":"2015-04-14T23:36:31Z","pushed_at":"2015-04-14T23:38:27Z","git_url":"git://github.com/Wikia/app.git","ssh_url":"git@github.com:Wikia/app.git","clone_url":"https://github.com/Wikia/app.git","svn_url":"https://github.com/Wikia/app","homepage":"http://dev.wikia.com","size":1390626,"stargazers_count":76,"watchers_count":76,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":57,"mirror_url":null,"open_issues_count":59,"forks":57,"open_issues":59,"watchers":76,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/Wikia/app/pulls/6931"},"html":{"href":"https://github.com/Wikia/app/pull/6931"},"issue":{"href":"https://api.github.com/repos/Wikia/app/issues/6931"},"comments":{"href":"https://api.github.com/repos/Wikia/app/issues/6931/comments"},"review_comments":{"href":"https://api.github.com/repos/Wikia/app/pulls/6931/comments"},"review_comment":{"href":"https://api.github.com/repos/Wikia/app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Wikia/app/pulls/6931/commits"},"statuses":{"href":"https://api.github.com/repos/Wikia/app/statuses/041b706c84d271f2cf207f027ca10f25e4f16f60"}}}}