[MediaWiki-commits] [Gerrit] mediawiki...trending-edits[master]: Remove unnecessary information
Ppchelko has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/325867 ) Change subject: Remove unnecessary information .. Remove unnecessary information Turns out these fields although interesting are not needed for trending so I'm going to remove them to simplify the codebase Change-Id: I651fbcf60a9c74fc0730fc7dedd06b3f5ae8a247 --- M lib/processor.js M test/features/lib/processor.js 2 files changed, 0 insertions(+), 7 deletions(-) Approvals: Ppchelko: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/processor.js b/lib/processor.js index 1d3286c..adf570b 100644 --- a/lib/processor.js +++ b/lib/processor.js @@ -128,11 +128,7 @@ } else { contributors.names[username].edits++; } -if (contributors.names[username].edits > contributors.names[contributors.main].edits) { -contributors.main = username; -} page.bytes = edit.rev_len - page.rev_len; -page.bias = contributors.names[contributors.main].edits / page.edits; // update pages.set(id, page); return true; diff --git a/test/features/lib/processor.js b/test/features/lib/processor.js index 5fc9d33..ecf4b4f 100644 --- a/test/features/lib/processor.js +++ b/test/features/lib/processor.js @@ -99,10 +99,7 @@ assert.ok( pages[0].contributors.anons === 2, 'Total unique anon edits is tallied up.' ); assert.ok( pages[0].contributors.names.Jon.edits === 2, 'Edits by Jon counted' ); assert.ok( pages[0].contributors.names['127.0.0.5'].edits === 1, 'Edits by anon counted' ); -assert.ok( pages[0].contributors.main === 'Bernd', 'Top editor recorded' ); assert.ok( pages[0].isNew === false, 'False isNew flag for pages with parent id' ); -assert.ok( pages[0].bias === 3 / 8, -'Bias is total edits by main author divided by total edits. The lower the less bias.' ); }); it('counts the number of anonymous edits', function() { -- To view, visit https://gerrit.wikimedia.org/r/325867 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I651fbcf60a9c74fc0730fc7dedd06b3f5ae8a247 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/trending-edits Gerrit-Branch: master Gerrit-Owner: JdlrobsonGerrit-Reviewer: BearND Gerrit-Reviewer: Mobrovac Gerrit-Reviewer: Ppchelko Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...trending-edits[master]: Remove unnecessary information
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/325867 ) Change subject: Remove unnecessary information .. Remove unnecessary information Turns out these fields although interesting are not needed for trending so I'm going to remove them to simplify the codebase Change-Id: I651fbcf60a9c74fc0730fc7dedd06b3f5ae8a247 --- M lib/processor.js M test/features/lib/processor.js 2 files changed, 0 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/trending-edits refs/changes/67/325867/1 diff --git a/lib/processor.js b/lib/processor.js index 1d3286c..adf570b 100644 --- a/lib/processor.js +++ b/lib/processor.js @@ -128,11 +128,7 @@ } else { contributors.names[username].edits++; } -if (contributors.names[username].edits > contributors.names[contributors.main].edits) { -contributors.main = username; -} page.bytes = edit.rev_len - page.rev_len; -page.bias = contributors.names[contributors.main].edits / page.edits; // update pages.set(id, page); return true; diff --git a/test/features/lib/processor.js b/test/features/lib/processor.js index 5fc9d33..ecf4b4f 100644 --- a/test/features/lib/processor.js +++ b/test/features/lib/processor.js @@ -99,10 +99,7 @@ assert.ok( pages[0].contributors.anons === 2, 'Total unique anon edits is tallied up.' ); assert.ok( pages[0].contributors.names.Jon.edits === 2, 'Edits by Jon counted' ); assert.ok( pages[0].contributors.names['127.0.0.5'].edits === 1, 'Edits by anon counted' ); -assert.ok( pages[0].contributors.main === 'Bernd', 'Top editor recorded' ); assert.ok( pages[0].isNew === false, 'False isNew flag for pages with parent id' ); -assert.ok( pages[0].bias === 3 / 8, -'Bias is total edits by main author divided by total edits. The lower the less bias.' ); }); it('counts the number of anonymous edits', function() { -- To view, visit https://gerrit.wikimedia.org/r/325867 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I651fbcf60a9c74fc0730fc7dedd06b3f5ae8a247 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/trending-edits Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits