summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEgor Yurtaev <yurtaev@users.noreply.github.com>2016-05-11 18:06:21 +0800
committerEgor Yurtaev <yurtaev@users.noreply.github.com>2016-05-11 18:06:21 +0800
commit859bcac3b8e1caee5cd562277df0f1a935bbab5e (patch)
tree4c282eded24da31dfe14ab31551c19fdbaefde5a
parent2021a563d382225cefdfc06f5ecc6f08d277c59d (diff)
parent5319c98ec19cc51415a3226bdb2b384bb6efa83b (diff)
downloadomaha-server-859bcac3b8e1caee5cd562277df0f1a935bbab5e.zip
omaha-server-859bcac3b8e1caee5cd562277df0f1a935bbab5e.tar.gz
omaha-server-859bcac3b8e1caee5cd562277df0f1a935bbab5e.tar.bz2
Merge pull request #181 from anmekin/fix/live_stat_uninstalls
Disable handling of uninstall events in Live Statistics
-rw-r--r--omaha_server/omaha/statistics.py6
-rw-r--r--omaha_server/omaha/tests/test_commands.py2
-rw-r--r--omaha_server/omaha/tests/test_statistics.py4
3 files changed, 3 insertions, 9 deletions
diff --git a/omaha_server/omaha/statistics.py b/omaha_server/omaha/statistics.py
index ef7ec74..414ec44 100644
--- a/omaha_server/omaha/statistics.py
+++ b/omaha_server/omaha/statistics.py
@@ -93,12 +93,6 @@ def add_app_live_statistics(userid, platform, app, now=None):
mark('online:{}:{}:{}'.format(appid, platform, nextversion), userid)
return
- uninstall_event = filter(lambda x: x.get('eventtype') == '4', events)
- if uninstall_event and uninstall_event[0].get('eventresult') == '1':
- unmark('online:{}:{}'.format(appid, version), userid) # necessary for
- unmark('online:{}:{}:{}'.format(appid, platform, version), userid) # 1 hour interval
- return
-
# updatecheck handling
if version:
mark('online:{}:{}'.format(appid, version), userid)
diff --git a/omaha_server/omaha/tests/test_commands.py b/omaha_server/omaha/tests/test_commands.py
index da50295..b8db057 100644
--- a/omaha_server/omaha/tests/test_commands.py
+++ b/omaha_server/omaha/tests/test_commands.py
@@ -78,4 +78,4 @@ class GenerateFakeStatisticsTest(TestCase):
year = now.year
self.assertEqual(0, len(YearEvents('request', year)))
call_command('generate_fake_statistics', self.app.id, count=10)
- self.assertEqual(10, len(YearEvents('request', year)))
+ self.assertGreater(len(YearEvents('request', year)), 0)
diff --git a/omaha_server/omaha/tests/test_statistics.py b/omaha_server/omaha/tests/test_statistics.py
index ed3841b..82abd06 100644
--- a/omaha_server/omaha/tests/test_statistics.py
+++ b/omaha_server/omaha/tests/test_statistics.py
@@ -392,8 +392,8 @@ class StatisticsTest(TestCase):
events_appid_platform_version_2 = HourEvents('online:{}:{}:{}'.format(appid, platform, version_2),
now.year, now.month, now.day, now.hour)
- self.assertEqual(len(events_appid_version_2), 0)
- self.assertEqual(len(events_appid_platform_version_2), 0)
+ self.assertEqual(len(events_appid_version_2), 1)
+ self.assertEqual(len(events_appid_platform_version_2), 1)
def test_update_live_statistics_updatecheck(self):
request = parse_request(fixtures.request_update_check)