Bug 1300715 - prevent newer registered histograms from using default r=chutten

"expires_in_version", and add old ones to the whitelist. r?chutten

MozReview-Commit-ID: Hp9rXdkQgBN

--HG--
extra : rebase_source : 51b4d2394bcfd027ddc19726483c91c857d5d3b3
This commit is contained in:
AdamG2 2016-10-04 23:50:08 -04:00
Родитель 34b4dad43f
Коммит db120e15b7
2 изменённых файлов: 102 добавлений и 3 удалений

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

@ -1998,5 +1998,98 @@
"GC_REASON_2",
"GC_MINOR_REASON",
"GC_MINOR_REASON_LONG"
]
],
"expiry_default": [
"A11Y_CONSUMERS",
"IDLE_NOTIFY_IDLE_MS",
"CACHE_MEMORY_SEARCH_2",
"OSFILE_WORKER_LAUNCH_MS",
"GEOLOCATION_OSX_SOURCE_IS_MLS",
"TRANSLATION_OPPORTUNITIES_BY_LANGUAGE",
"FX_THUMBNAILS_BG_CAPTURE_DONE_REASON_2",
"TRANSLATED_PAGES",
"FX_SESSION_RESTORE_SEND_UPDATE_CAUSED_OOM",
"SSL_PERMANENT_CERT_ERROR_OVERRIDES",
"FX_THUMBNAILS_BG_QUEUE_SIZE_ON_CAPTURE",
"AUTO_REJECTED_TRANSLATION_OFFERS",
"TRANSLATED_CHARACTERS",
"WEAVE_CONFIGURED",
"NEWTAB_PAGE_ENABLED",
"GRADIENT_DURATION",
"MOZ_SQLITE_OPEN_MS",
"SHOULD_TRANSLATION_UI_APPEAR",
"NEWTAB_PAGE_LIFE_SPAN",
"FX_TOTAL_TOP_VISITS",
"FX_SESSION_RESTORE_NUMBER_OF_EAGER_TABS_RESTORED",
"CACHE_DISK_SEARCH_2",
"FX_THUMBNAILS_BG_CAPTURE_QUEUE_TIME_MS",
"NEWTAB_PAGE_PINNED_SITES_COUNT",
"WEAVE_COMPLETE_SUCCESS_COUNT",
"A11Y_UPDATE_TIME",
"OSFILE_WRITEATOMIC_JANK_MS",
"STARTUP_MEASUREMENT_ERRORS",
"CERT_CHAIN_KEY_SIZE_STATUS",
"CHANGES_OF_TARGET_LANGUAGE",
"FX_NEW_WINDOW_MS",
"PDF_VIEWER_TIME_TO_VIEW_MS",
"SSL_OCSP_MAY_FETCH",
"MOZ_SQLITE_OTHER_READ_B",
"CHECK_JAVA_ENABLED",
"TRANSLATION_OPPORTUNITIES",
"FX_SESSION_RESTORE_CONTENT_COLLECT_DATA_LONGEST_OP_MS",
"NEWTAB_PAGE_BLOCKED_SITES_COUNT",
"FX_SESSION_RESTORE_NUMBER_OF_TABS_RESTORED",
"WEAVE_START_COUNT",
"FX_SESSION_RESTORE_RESTORE_WINDOW_MS",
"NEWTAB_PAGE_LIFE_SPAN_SUGGESTED",
"HTTP_DISK_CACHE_OVERHEAD",
"FX_SESSION_RESTORE_CORRUPT_FILE",
"FX_TAB_CLICK_MS",
"LOCALDOMSTORAGE_GETVALUE_BLOCKING_MS",
"PDF_VIEWER_DOCUMENT_VERSION",
"GEOLOCATION_ACCURACY_EXPONENTIAL",
"FX_SESSION_RESTORE_READ_FILE_MS",
"CHANGES_OF_DETECTED_LANGUAGE",
"OSFILE_WORKER_READY_MS",
"PDF_VIEWER_FORM",
"FX_SESSION_RESTORE_AUTO_RESTORE_DURATION_UNTIL_EAGER_TABS_RESTORED_MS",
"FX_SESSION_RESTORE_COLLECT_DATA_MS",
"FX_SESSION_RESTORE_FILE_SIZE_BYTES",
"STARTUP_CACHE_AGE_HOURS",
"FX_SESSION_RESTORE_DOM_STORAGE_SIZE_ESTIMATE_CHARS",
"DATA_STORAGE_ENTRIES",
"TRANSLATED_PAGES_BY_LANGUAGE",
"MOZ_SQLITE_OTHER_WRITE_B",
"LOCALDOMSTORAGE_SHUTDOWN_DATABASE_MS",
"SSL_CERT_VERIFICATION_ERRORS",
"FX_SESSION_RESTORE_NUMBER_OF_WINDOWS_RESTORED",
"MOZ_SQLITE_PLACES_WRITE_MS",
"FX_THUMBNAILS_BG_CAPTURE_CANVAS_DRAW_TIME_MS",
"FX_SESSION_RESTORE_STARTUP_INIT_SESSION_MS",
"FX_SESSION_RESTORE_WRITE_FILE_MS",
"FX_THUMBNAILS_BG_CAPTURE_PAGE_LOAD_TIME_MS",
"REQUESTS_OF_ORIGINAL_CONTENT",
"NEWTAB_PAGE_ENHANCED",
"CERT_CHAIN_SHA1_POLICY_STATUS",
"PDF_VIEWER_DOCUMENT_SIZE_KB",
"FX_THUMBNAILS_BG_CAPTURE_SERVICE_TIME_MS",
"SHUTDOWN_OK",
"PLACES_BACKUPS_TOJSON_MS",
"A11Y_ISIMPLEDOM_USAGE_FLAG",
"FX_SESSION_RESTORE_MANUAL_RESTORE_DURATION_UNTIL_EAGER_TABS_RESTORED_MS",
"PDF_VIEWER_DOCUMENT_GENERATOR",
"PDF_VIEWER_FALLBACK_SHOWN",
"FX_SESSION_RESTORE_ALL_FILES_CORRUPT",
"SHOULD_AUTO_DETECT_LANGUAGE",
"A11Y_IATABLE_USAGE_FLAG",
"FX_PAGE_LOAD_MS",
"LOCALDOMSTORAGE_PRELOAD_PENDING_ON_FIRST_ACCESS",
"DENIED_TRANSLATION_OFFERS",
"XUL_CACHE_DISABLED",
"PAGE_FAULTS_HARD",
"BROWSERPROVIDER_XUL_IMPORT_BOOKMARKS",
"PDF_VIEWER_USED",
"NETWORK_DISK_CACHE_OPEN",
"GEOLOCATION_WIN8_SOURCE_IS_MLS"
]
}

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

@ -258,17 +258,23 @@ associated with the histogram. Returns None if no guarding is necessary."""
raise ValueError, "Histogram name '%s' doesn't confirm to '%s'" % (name, pattern)
def check_expiration(self, name, definition):
expiration = definition.get('expires_in_version')
field = 'expires_in_version'
expiration = definition.get(field)
if not expiration:
return
# We forbid new probes from using "expires_in_version" : "default" field/value pair.
# Old ones that use this are added to the whitelist.
if expiration == "default" and name not in whitelists['expiry_default']:
raise ValueError, 'New histogram "%s" cannot have "default" %s value.' % (name, field)
if re.match(r'^[1-9][0-9]*$', expiration):
expiration = expiration + ".0a1"
elif re.match(r'^[1-9][0-9]*\.0$', expiration):
expiration = expiration + "a1"
definition['expires_in_version'] = expiration
definition[field] = expiration
def check_label_values(self, name, definition):
labels = definition.get('labels')