Milimetric has submitted this change and it was merged.
Change subject: merge. changes in revert_rate.py
......................................................................
merge. changes in revert_rate.py
Change-Id: I23ee9d7d9aab89465d73bb711a4fc81dbc48d8c5
merge. changes in revert_rate.py
Change-Id: Ic3bc24ae24ef5609d16f79c15dfbb6d896ab7f6f
add. test for RevertRate.
Change-Id: Ia93567569c604564c30a3e76371c03570b2305b7
tag. UMAPI version 0.1.5.
Change-Id: Id41fc14a95882ab2d416c85bb86b3c07dc8a145c
---
M CHANGES
M user_metrics/metrics/revert_rate.py
M user_metrics/test/tests.py
3 files changed, 49 insertions(+), 7 deletions(-)
Approvals:
Milimetric: Verified; Looks good to me, approved
diff --git a/CHANGES b/CHANGES
index 0c85e91..59e1a84 100644
--- a/CHANGES
+++ b/CHANGES
@@ -41,7 +41,7 @@
like survival and threshold. This can be bettet
- Refactor API source - break up functionality for easier maintenance and
extensibility.
-- Manage requests via a separate job manager.
+- Manage requests via a separate Job Controller (JC).
user_metrics.api.engine.request_manager module.
- Generate unique hashes from Request objects.
build_key_signature method in user_metrics.api.engine.data
@@ -61,9 +61,9 @@
- More robust testing.
- added some testing
- Interface to load cohorts
-- Request notifications listener
+- Request notifications listener (RNL) that handle
- Update request_manager module to handle larger responses on the queue
-- Response Handler that builds responses for caching as they finish
+- Response Handler (RH) that builds responses for caching as they finish
- Add backend facility for loading cohorts
(add_cohort_data in query_calls module)
- Add backend facility for registering users (session.py)
@@ -76,9 +76,10 @@
https://github.com/wikimedia/user_metrics/pull/14
https://github.com/wikimedia/user_metrics/pull/15
https://github.com/wikimedia/user_metrics/pull/16
+https://github.com/wikimedia/user_metrics/pull/17
-Version 0.1.5-dev
+Version 0.1.5
-----------------
To be released on April 15th 2013.
@@ -91,6 +92,25 @@
- Facility for importing cohorts
- Fix/Test Single user endpoint request
- Fix/Test cohort combo request
+- Fix/Test magic keyword cohort request
+ (e.g. cohorts/all/threshold?start=20120101&end=20120102)
+- Exception handling in metric worker threads
+- Fall back on user table if user registration date not found in logging
+- displaying logged in user in nav bar
+- Modify PROJECT_MAP generation to use "noc.wikiedia.org"
+- Define methods with locks to make requests to RNL about jobs
+- Handle "invalid" values for live account metric
+- Rename "average" aggregators to "proportion", and "mean" where relevant
+- Rename "interval" parameter to "slice"
+- Better exception handling around retrieving results from cache
+- URIs filtered and persisted in RequestMeta objects entirely
+- TimeToThreshold now simplified and uses multiprocessing Pools
+- Fixed RevertRate
+
+
+https://github.com/wikimedia/user_metrics/pull/18
+...
+https://github.com/wikimedia/user_metrics/pull/28
Future Work
diff --git a/user_metrics/metrics/revert_rate.py
b/user_metrics/metrics/revert_rate.py
index a1e8fc8..d4478db 100644
--- a/user_metrics/metrics/revert_rate.py
+++ b/user_metrics/metrics/revert_rate.py
@@ -239,5 +239,3 @@
'average_rate',])
setattr(revert_rate_avg, um.METRIC_AGG_METHOD_KWARGS, {'val_idx' : 1,
'weight_idx' : 1})
-
-
diff --git a/user_metrics/test/tests.py b/user_metrics/test/tests.py
index 445cfde..ed6298b 100644
--- a/user_metrics/test/tests.py
+++ b/user_metrics/test/tests.py
@@ -20,6 +20,8 @@
from user_metrics.config import settings
from user_metrics.etl.data_loader import Connector, ConnectorError
+from user_metrics.metrics import revert_rate
+
# User Metric tests
# =================
@@ -74,8 +76,26 @@
assert False # TODO: implement your test here
+
def test_revert_rate():
- assert False # TODO: implement your test here
+ r = revert_rate.RevertRate()
+ users = {
+ '17792132': 0.0,
+ '17797320': 0.5,
+ '17792130': 0.0,
+ '17792131': 0.0,
+ '17792136': 0.0,
+ '17792137': 0.0,
+ '17792134': 0.0,
+ '17797328': 0.0,
+ '17797329': 0.0,
+ '17792138': 1.0
+ }
+
+ for r in r.process(users.keys(), k_=1, kr_=1, log_=True):
+ if not float(r[1]) == float(users[str(r[0])]):
+ assert False
+ assert True
def test_user():
@@ -228,3 +248,7 @@
def test_recordtype():
assert False # TODO: implement your test here
+
+
+if __name__ == '__main__':
+ test_revert_rate()
--
To view, visit https://gerrit.wikimedia.org/r/59858
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id41fc14a95882ab2d416c85bb86b3c07dc8a145c
Gerrit-PatchSet: 1
Gerrit-Project: analytics/E3Analysis
Gerrit-Branch: master
Gerrit-Owner: Rfaulk <[email protected]>
Gerrit-Reviewer: DarTar <[email protected]>
Gerrit-Reviewer: Diederik <[email protected]>
Gerrit-Reviewer: Erosen <[email protected]>
Gerrit-Reviewer: Milimetric <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits