[MediaWiki-commits] [Gerrit] Get rid of focus on daily aggregates - change (analytics/aggregator)

2015-01-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Get rid of focus on daily aggregates
..


Get rid of focus on daily aggregates

This switch prepares to have different kinds of projectcount
aggregates.

Change-Id: Id483f01ec9d8507466cfb1e268d5ee803c98654e
---
M aggregator/projectcounts.py
M bin/aggregate_projectcounts
M tests/test_projectcounts.py
3 files changed, 26 insertions(+), 25 deletions(-)

Approvals:
  Nuria: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/aggregator/projectcounts.py b/aggregator/projectcounts.py
index 230b2ec..96b13e8 100644
--- a/aggregator/projectcounts.py
+++ b/aggregator/projectcounts.py
@@ -123,8 +123,9 @@
 return date_data.get(webstatscollector_abbreviation, 0)
 
 
-def update_daily_per_project_csvs(source_dir_abs, target_dir_abs, first_date,
-  last_date, force_recomputation=False):
+def update_per_project_csvs_for_dates(
+source_dir_abs, target_dir_abs, first_date, last_date,
+force_recomputation=False):
 """Updates daily per project CSVs from hourly projectcounts files.
 
 The existing per project CSV files in target_dir_abs are updated with daily
diff --git a/bin/aggregate_projectcounts b/bin/aggregate_projectcounts
index 5b10343..b463bd4 100755
--- a/bin/aggregate_projectcounts
+++ b/bin/aggregate_projectcounts
@@ -14,7 +14,7 @@
 # limitations under the License.
 
 """
-Aggregates Wikimedia's hourly projectcount files into daily per project files
+Aggregates Wikimedia's hourly projectcount files into per project CSVs
 
 Usage: aggregate_projectcounts [--source SOURCE_DIR] [--target TARGET_DIR]
[--first-date FIRST_DATE] [--last-date LAST_DATE] [--date DATE]
@@ -166,7 +166,7 @@
 run_git(['pull', '--quiet'])
 run_git(['reset', '--quiet', '--hard', 'origin/master'])
 
-aggregator.update_daily_per_project_csvs(
+aggregator.update_per_project_csvs_for_dates(
 source_dir_abs,
 target_dir_abs,
 first_date,
diff --git a/tests/test_projectcounts.py b/tests/test_projectcounts.py
index f9336fe..94efdef 100644
--- a/tests/test_projectcounts.py
+++ b/tests/test_projectcounts.py
@@ -216,17 +216,17 @@
 
 self.assertEquals(actual, 0)
 
-def test_update_daily_per_project_no_csvs(self):
+def test_update_per_project_no_csvs(self):
 fixture = os.path.join(FIXTURES_DIR_ABS,
'2014-11-missing-hours')
 date = datetime.date(2014, 11, 1)
 
 tmp_dir_abs = self.create_tmp_dir_abs()
 
-aggregator.update_daily_per_project_csvs(fixture, tmp_dir_abs,
- date, date)
+aggregator.update_per_project_csvs_for_dates(fixture, tmp_dir_abs,
+ date, date)
 
-def test_update_daily_per_project_single_csvs_missing_hours(self):
+def test_update_per_project_single_csvs_missing_hours(self):
 fixture = os.path.join(FIXTURES_DIR_ABS,
'2014-11-missing-hours')
 date = datetime.date(2014, 11, 1)
@@ -238,13 +238,13 @@
 
 nose.tools.assert_raises(
 RuntimeError,
-aggregator.update_daily_per_project_csvs,
+aggregator.update_per_project_csvs_for_dates,
 fixture,
 tmp_dir_abs,
 date,
 date)
 
-def test_update_daily_per_project_single_csvs_missing_hours_existing(self):
+def test_update_per_project_single_csvs_missing_hours_existing(self):
 fixture = os.path.join(FIXTURES_DIR_ABS,
'2014-11-3days-enwiki-day-times-100-plus-hour')
 date = datetime.date(2014, 11, 1)
@@ -256,7 +256,7 @@
 '2014-11-01,1,2,3,4'
 ])
 
-aggregator.update_daily_per_project_csvs(
+aggregator.update_per_project_csvs_for_dates(
 fixture,
 tmp_dir_abs,
 date,
@@ -266,7 +266,7 @@
 '2014-11-01,1,2,3,4',
 ])
 
-def test_update_daily_per_project_single_csvs_3days_2014_11_01(self):
+def test_update_per_project_single_csvs_3days_2014_11_01(self):
 fixture = os.path.join(FIXTURES_DIR_ABS,
'2014-11-3days-enwiki-day-times-100-plus-hour')
 date = datetime.date(2014, 11, 1)
@@ -276,7 +276,7 @@
 enwiki_file_abs = os.path.join(tmp_dir_abs, 'enwiki.csv')
 self.create_empty_file(enwiki_file_abs)
 
-aggregator.update_daily_per_project_csvs(
+aggregator.update_per_project_csvs_for_dates(
 fixture,
 tmp_dir_abs,
 date,
@@ -286,7 +286,7 @@
 '2014-11-01,24276,24276,0,0',
 ])
 
-def test_update_daily_per_project_single_csvs_3days_2014_11_02(self):
+def test_update_per_project_single_csvs_3days_2014_11_02(self):
   

[MediaWiki-commits] [Gerrit] Get rid of focus on daily aggregates - change (analytics/aggregator)

2015-01-04 Thread QChris (Code Review)
QChris has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/182662

Change subject: Get rid of focus on daily aggregates
..

Get rid of focus on daily aggregates

This switch prepares to have different kinds of projectcount
aggregates.

Change-Id: Id483f01ec9d8507466cfb1e268d5ee803c98654e
---
M aggregator/projectcounts.py
M bin/aggregate_projectcounts
M tests/test_projectcounts.py
3 files changed, 26 insertions(+), 25 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/aggregator 
refs/changes/62/182662/1

diff --git a/aggregator/projectcounts.py b/aggregator/projectcounts.py
index 230b2ec..96b13e8 100644
--- a/aggregator/projectcounts.py
+++ b/aggregator/projectcounts.py
@@ -123,8 +123,9 @@
 return date_data.get(webstatscollector_abbreviation, 0)
 
 
-def update_daily_per_project_csvs(source_dir_abs, target_dir_abs, first_date,
-  last_date, force_recomputation=False):
+def update_per_project_csvs_for_dates(
+source_dir_abs, target_dir_abs, first_date, last_date,
+force_recomputation=False):
 """Updates daily per project CSVs from hourly projectcounts files.
 
 The existing per project CSV files in target_dir_abs are updated with daily
diff --git a/bin/aggregate_projectcounts b/bin/aggregate_projectcounts
index 5b10343..b463bd4 100755
--- a/bin/aggregate_projectcounts
+++ b/bin/aggregate_projectcounts
@@ -14,7 +14,7 @@
 # limitations under the License.
 
 """
-Aggregates Wikimedia's hourly projectcount files into daily per project files
+Aggregates Wikimedia's hourly projectcount files into per project CSVs
 
 Usage: aggregate_projectcounts [--source SOURCE_DIR] [--target TARGET_DIR]
[--first-date FIRST_DATE] [--last-date LAST_DATE] [--date DATE]
@@ -166,7 +166,7 @@
 run_git(['pull', '--quiet'])
 run_git(['reset', '--quiet', '--hard', 'origin/master'])
 
-aggregator.update_daily_per_project_csvs(
+aggregator.update_per_project_csvs_for_dates(
 source_dir_abs,
 target_dir_abs,
 first_date,
diff --git a/tests/test_projectcounts.py b/tests/test_projectcounts.py
index f9336fe..94efdef 100644
--- a/tests/test_projectcounts.py
+++ b/tests/test_projectcounts.py
@@ -216,17 +216,17 @@
 
 self.assertEquals(actual, 0)
 
-def test_update_daily_per_project_no_csvs(self):
+def test_update_per_project_no_csvs(self):
 fixture = os.path.join(FIXTURES_DIR_ABS,
'2014-11-missing-hours')
 date = datetime.date(2014, 11, 1)
 
 tmp_dir_abs = self.create_tmp_dir_abs()
 
-aggregator.update_daily_per_project_csvs(fixture, tmp_dir_abs,
- date, date)
+aggregator.update_per_project_csvs_for_dates(fixture, tmp_dir_abs,
+ date, date)
 
-def test_update_daily_per_project_single_csvs_missing_hours(self):
+def test_update_per_project_single_csvs_missing_hours(self):
 fixture = os.path.join(FIXTURES_DIR_ABS,
'2014-11-missing-hours')
 date = datetime.date(2014, 11, 1)
@@ -238,13 +238,13 @@
 
 nose.tools.assert_raises(
 RuntimeError,
-aggregator.update_daily_per_project_csvs,
+aggregator.update_per_project_csvs_for_dates,
 fixture,
 tmp_dir_abs,
 date,
 date)
 
-def test_update_daily_per_project_single_csvs_missing_hours_existing(self):
+def test_update_per_project_single_csvs_missing_hours_existing(self):
 fixture = os.path.join(FIXTURES_DIR_ABS,
'2014-11-3days-enwiki-day-times-100-plus-hour')
 date = datetime.date(2014, 11, 1)
@@ -256,7 +256,7 @@
 '2014-11-01,1,2,3,4'
 ])
 
-aggregator.update_daily_per_project_csvs(
+aggregator.update_per_project_csvs_for_dates(
 fixture,
 tmp_dir_abs,
 date,
@@ -266,7 +266,7 @@
 '2014-11-01,1,2,3,4',
 ])
 
-def test_update_daily_per_project_single_csvs_3days_2014_11_01(self):
+def test_update_per_project_single_csvs_3days_2014_11_01(self):
 fixture = os.path.join(FIXTURES_DIR_ABS,
'2014-11-3days-enwiki-day-times-100-plus-hour')
 date = datetime.date(2014, 11, 1)
@@ -276,7 +276,7 @@
 enwiki_file_abs = os.path.join(tmp_dir_abs, 'enwiki.csv')
 self.create_empty_file(enwiki_file_abs)
 
-aggregator.update_daily_per_project_csvs(
+aggregator.update_per_project_csvs_for_dates(
 fixture,
 tmp_dir_abs,
 date,
@@ -286,7 +286,7 @@
 '2014-11-01,24276,24276,0,0',
 ])
 
-def test_update_daily_per_project_single_csvs_3days_2014_11_02(self):
+def test_update_per_proj