Bug 1491330 - allow different submission_dates (#258)

This commit is contained in:
Frank Bertsch 2018-09-14 13:29:31 -05:00 коммит произвёл GitHub
Родитель 006520c5e8
Коммит 69ac6b9d67
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 8 добавлений и 4 удалений

Просмотреть файл

@ -240,8 +240,12 @@ def get_latest_valid_per_client(entry, time_start, time_end):
"""
latest_entry = None
for index, pkt_date in enumerate(entry["submission_date"]):
sub_date = dt.datetime.strptime(
pkt_date, "%Y-%m-%dT%H:%M:%S.%fZ").date()
try:
sub_date = dt.datetime.strptime(
pkt_date, "%Y-%m-%dT%H:%M:%S.%fZ").date()
except ValueError:
sub_date = dt.datetime.strptime(
pkt_date, "%Y-%m-%dT%H:%M:%SZ").date()
# The data is in descending order, the most recent ping comes first.
# The first item less or equal than the time_end date is our thing.

Просмотреть файл

@ -1,2 +1,2 @@
{"build": [{"application_id": "{fake-id}", "application_name": "Firefox", "architecture": "x86"}], "client_id": "1", "active_plugins": ["Adobe Acrobat"], "system_os": [{"name": "Windows", "version": "10.0"}], "submission_date": ["2016-12-07T00:00:00.000Z"], "system": [{"memory_mb": 16345, "virtual_max_mb": 4096, "is_wow64": true}], "system_gfx": [{"adapters": [{"description": "AMD Radeon R9 200 Series", "vendor_id": "0x1002", "device_id": "0x6810"}], "monitors": [{"screen_width": 1920, "screen_height": 1200, "refresh_rate": 60, "pseudo_display": false, "scale": null}]}], "system_cpu": [{"cores": 4, "vendor": "AuthenticAMD", "speed_mhz": 4018}], "normalized_channel": "beta"}
{"build": [{"application_id": "{fake-id}", "application_name": "Firefox", "architecture": "x86"}], "client_id": "3", "active_plugins": [], "system_os": [{"name": "Windows", "version": "10.0"}], "submission_date": ["2016-07-05T00:00:00.000Z"], "system": [{"memory_mb": 7894, "virtual_max_mb": 4096, "is_wow64": true}], "system_gfx": [{"adapters": [{"description": "Intel(R) HD Graphics 520", "vendor_id": "0x1002", "device_id": "0x6810"}], "monitors": [{"screen_width": 1920, "screen_height": 1200, "refresh_rate": 60, "pseudo_display": false, "scale": null}]}], "system_cpu": [{"cores": 4, "vendor": "GenuineIntel", "speed_mhz": 4018}], "normalized_channel": "release"}
{"build": [{"application_id": "{fake-id}", "application_name": "Firefox", "architecture": "x86"}], "client_id": "1", "active_plugins": ["Adobe Acrobat"], "system_os": [{"name": "Windows", "version": "10.0"}], "submission_date": ["2016-12-07T00:00:00Z"], "system": [{"memory_mb": 16345, "virtual_max_mb": 4096, "is_wow64": true}], "system_gfx": [{"adapters": [{"description": "AMD Radeon R9 200 Series", "vendor_id": "0x1002", "device_id": "0x6810"}], "monitors": [{"screen_width": 1920, "screen_height": 1200, "refresh_rate": 60, "pseudo_display": false, "scale": null}]}], "system_cpu": [{"cores": 4, "vendor": "AuthenticAMD", "speed_mhz": 4018}], "normalized_channel": "beta"}
{"build": [{"application_id": "{fake-id}", "application_name": "Firefox", "architecture": "x86"}], "client_id": "3", "active_plugins": [], "system_os": [{"name": "Windows", "version": "10.0"}], "submission_date": ["2016-07-05T00:00:00.000Z"], "system": [{"memory_mb": 7894, "virtual_max_mb": 4096, "is_wow64": true}], "system_gfx": [{"adapters": [{"description": "Intel(R) HD Graphics 520", "vendor_id": "0x1002", "device_id": "0x6810"}], "monitors": [{"screen_width": 1920, "screen_height": 1200, "refresh_rate": 60, "pseudo_display": false, "scale": null}]}], "system_cpu": [{"cores": 4, "vendor": "GenuineIntel", "speed_mhz": 4018}], "normalized_channel": "release"}