Skip to content

Instantly share code, notes, and snippets.

@hackebrot
Forked from mdboom/android-components.csv
Created December 11, 2020 17:06
Show Gist options
  • Save hackebrot/cf1b608967fb034328b3fe16bf62cfcf to your computer and use it in GitHub Desktop.
Save hackebrot/cf1b608967fb034328b3fe16bf62cfcf to your computer and use it in GitHub Desktop.
Glean testing coverage
category name tested
basic os False
bookmarks_sync failure_reason False
bookmarks_sync finished_at False
bookmarks_sync incoming False
bookmarks_sync outgoing False
bookmarks_sync outgoing_batches False
bookmarks_sync remote_tree_problems False
bookmarks_sync started_at False
bookmarks_sync uid False
browser.engagement click False
browser.engagement event_no_keys False
crash_metrics crash_count False
custom counter False
fxa_tab received True
fxa_tab sent True
history_sync failure_reason False
history_sync finished_at False
history_sync incoming False
history_sync outgoing False
history_sync outgoing_batches False
history_sync started_at False
history_sync uid False
logins_sync failure_reason False
logins_sync finished_at False
logins_sync incoming False
logins_sync outgoing False
logins_sync outgoing_batches False
logins_sync started_at False
logins_sync uid False
migration migration_versions False
migration.addons any_failures False
migration.addons failed_addons False
migration.addons failure_reason False
migration.addons migrated_addons False
migration.addons success_reason False
migration.addons total_duration False
migration.bookmarks any_failures False
migration.bookmarks detected False
migration.bookmarks duration False
migration.bookmarks failure_reason False
migration.bookmarks migrated False
migration.bookmarks success_reason False
migration.bookmarks total_duration False
migration.fxa any_failures False
migration.fxa bad_auth_state False
migration.fxa failure_reason False
migration.fxa has_custom_idp_server False
migration.fxa has_custom_token_server False
migration.fxa success_reason False
migration.fxa total_duration False
migration.fxa unsupported_account_version False
migration.fxa unsupported_pickle_version False
migration.fxa unsupported_state_version False
migration.gecko any_failures False
migration.gecko failure_reason False
migration.gecko success_reason False
migration.gecko total_duration False
migration.history any_failures False
migration.history detected False
migration.history duration False
migration.history failure_reason False
migration.history migrated False
migration.history success_reason False
migration.history total_duration False
migration.logins any_failures False
migration.logins detected False
migration.logins failure_counts False
migration.logins failure_reason False
migration.logins success_reason False
migration.logins total_duration False
migration.logins unsupported_db_version False
migration.open_tabs any_failures False
migration.open_tabs detected False
migration.open_tabs failure_reason False
migration.open_tabs migrated False
migration.open_tabs success_reason False
migration.open_tabs total_duration False
migration.pinned_sites any_failures False
migration.pinned_sites detected_pinned_sites False
migration.pinned_sites failure_reason False
migration.pinned_sites migrated_pinned_sites False
migration.pinned_sites success_reason False
migration.pinned_sites total_duration False
migration.search any_failures False
migration.search failure_reason False
migration.search success_reason False
migration.search total_duration False
migration.settings any_failures False
migration.settings failure_reason False
migration.settings success_reason False
migration.settings telemetry_enabled False
migration.settings total_duration False
migration.telemetry_identifiers any_failures False
migration.telemetry_identifiers failure_reason False
migration.telemetry_identifiers fennec_client_id False
migration.telemetry_identifiers fennec_profile_creation_date False
migration.telemetry_identifiers success_reason False
migration.telemetry_identifiers total_duration False
sample_metrics test False
sync failure_reason False
sync sync_uuid True
test counter False
test string_list False
test timespan False
category name tested
about_page privacy_notice_tapped False
about_page support_tapped False
activation activation_id False
activation identifier False
addons enabled_addons False
addons has_enabled_addons False
addons has_installed_addons False
addons installed_addons False
addons open_addon_in_toolbar_menu False
addons open_addons_in_settings False
app_theme dark_theme_selected False
autoplay setting_changed False
autoplay visited_setting False
bookmarks_management copied False
bookmarks_management edited False
bookmarks_management folder_add False
bookmarks_management folder_remove False
bookmarks_management moved False
bookmarks_management multi_removed False
bookmarks_management open_in_new_tab False
bookmarks_management open_in_new_tabs False
bookmarks_management open_in_private_tab False
bookmarks_management open_in_private_tabs False
bookmarks_management removed False
bookmarks_management shared False
browser.search ad_clicks False
browser.search in_content False
browser.search with_ads False
collections add_tab_button False
collections all_tabs_restored False
collections long_press False
collections removed False
collections rename_button False
collections renamed False
collections save_button False
collections saved False
collections shared False
collections tab_removed False
collections tab_restored False
collections tab_select_opened False
collections tabs_added False
context_menu item_tapped False
contextual_hint.tracking_protection dismiss False
contextual_hint.tracking_protection display False
contextual_hint.tracking_protection inside_tap False
contextual_hint.tracking_protection outside_tap False
crash_reporter closed False
crash_reporter opened False
custom_tab action_button False
custom_tab closed False
custom_tab menu False
download_notification cancel False
download_notification in_app_open False
download_notification in_app_try_again False
download_notification open False
download_notification pause False
download_notification resume False
download_notification try_again False
error_page visited_error False
events app_opened True
events app_opened_all_startup False
events app_received_intent False
events browser_menu_action False
events entered_url False
events opened_link False
events performed_search False
events preference_toggled False
events search_bar_tapped False
events tab_counter_menu_action False
events total_uri_count False
events whats_new_tapped False
find_in_page closed False
find_in_page opened False
find_in_page searched_page False
first_session adgroup False
first_session campaign False
first_session creative False
first_session network False
first_session timestamp False
history opened False
history opened_item False
history removed False
history removed_all False
history shared False
login_dialog cancelled False
login_dialog displayed False
login_dialog never_save False
login_dialog saved False
logins copy_login False
logins delete_saved_login False
logins open_individual_login False
logins open_login_editor False
logins open_logins False
logins save_edited_login False
logins save_logins_setting_changed False
logins view_password_login False
master_password displayed False
master_password migration False
media_notification pause False
media_notification play False
media_state pause False
media_state play False
media_state stop False
metrics adjust_ad_group False
metrics adjust_campaign False
metrics adjust_creative False
metrics adjust_network False
metrics close_tab_setting False
metrics default_browser True
metrics default_moz_browser True
metrics has_open_tabs False
metrics has_recent_pwas False
metrics has_top_sites False
metrics mozilla_products True
metrics recently_used_pwa_count False
metrics search_count False
metrics search_widget_installed False
metrics tab_view_setting False
metrics tabs_open_count False
metrics toolbar_position False
metrics top_sites_count False
onboarding finish False
onboarding fxa_auto_signin False
onboarding fxa_manual_signin False
onboarding pref_toggled_private_browsing False
onboarding pref_toggled_theme_picker False
onboarding pref_toggled_toolbar_position False
onboarding pref_toggled_tracking_prot False
onboarding privacy_notice False
onboarding whats_new False
perf.awesomebar bookmark_suggestions False
perf.awesomebar clipboard_suggestions False
perf.awesomebar history_suggestions False
perf.awesomebar search_engine_suggestions False
perf.awesomebar session_suggestions False
perf.awesomebar shortcuts_suggestions False
perf.awesomebar synced_tabs_suggestions False
pocket pocket_top_site_clicked False
pocket pocket_top_site_removed False
preferences accessibility_services False
preferences open_links_in_a_private_tab False
preferences open_links_in_app False
preferences remote_debugging False
preferences search_bookmarks False
preferences search_browsing_history False
preferences search_suggestions_private False
preferences show_clipboard_suggestions False
preferences show_search_shortcuts False
preferences show_search_suggestions False
preferences show_voice_search False
preferences sync False
preferences sync_items False
preferences telemetry False
preferences theme False
preferences toolbar_position False
preferences tracking_protection False
private_browsing_mode garbage_icon False
private_browsing_mode notification_delete False
private_browsing_mode notification_open False
private_browsing_mode notification_tapped False
private_browsing_mode snackbar_undo False
private_browsing_shortcut cfr_add_shortcut False
private_browsing_shortcut cfr_cancel False
private_browsing_shortcut create_shortcut False
private_browsing_shortcut pinned_shortcut_priv False
private_browsing_shortcut static_shortcut_priv False
private_browsing_shortcut static_shortcut_tab False
progressive_web_app background False
progressive_web_app foreground False
progressive_web_app homescreen_tap False
progressive_web_app install_tap False
qr_scanner navigation_allowed False
qr_scanner navigation_denied False
qr_scanner opened False
qr_scanner prompt_displayed False
reader_mode appearance False
reader_mode available False
reader_mode closed False
reader_mode opened False
search.default_engine code True
search.default_engine name True
search.default_engine submission_url True
search_shortcuts selected False
search_suggestions enable_in_private False
search_widget new_tab_button False
search_widget voice_button False
search_widget_cfr add_widget_pressed False
search_widget_cfr canceled False
search_widget_cfr displayed False
search_widget_cfr not_now_pressed False
startup.timeline clock_ticks_per_second False
startup.timeline framework_start False
startup.timeline framework_start_error False
startup.timeline framework_start_read_error False
storage.stats app_bytes False
storage.stats cache_bytes False
storage.stats data_dir_bytes False
storage.stats query_stats_duration False
sync_account closed False
sync_account opened False
sync_account send_tab False
sync_account sign_in_to_send_tab False
sync_account sync_now False
sync_auth auto_login False
sync_auth closed False
sync_auth opened False
sync_auth other_external False
sync_auth paired False
sync_auth recovered False
sync_auth scan_pairing False
sync_auth sign_in False
sync_auth sign_out False
sync_auth sign_up False
sync_auth use_email False
sync_auth use_email_problem False
tab media_pause False
tab media_play False
tabs setting_opened False
tabs_tray close_all_tabs False
tabs_tray closed False
tabs_tray closed_existing_tab False
tabs_tray menu_opened False
tabs_tray new_private_tab_tapped False
tabs_tray new_tab_tapped False
tabs_tray normal_mode_tapped False
tabs_tray opened False
tabs_tray opened_existing_tab False
tabs_tray private_mode_tapped False
tabs_tray save_to_collection False
tabs_tray share_all_tabs False
tip closed False
tip displayed False
tip pressed False
toolbar_settings changed_position False
top_sites long_press False
top_sites open_default False
top_sites open_frecency False
top_sites open_in_new_tab False
top_sites open_in_private_tab False
top_sites open_pinned False
top_sites remove False
top_sites swipe_carousel False
tracking_protection etp_setting_changed False
tracking_protection etp_settings False
tracking_protection etp_shield False
tracking_protection etp_tracker_list False
tracking_protection exception_added False
tracking_protection panel_settings False
user_specified_search_engines custom_engine_added False
user_specified_search_engines custom_engine_deleted False
voice_search tapped False
# Find metrics that never use the Glean testing API
import argparse
from pathlib import Path
import sys
from glean_parser import parser, util
def find_testing_apis(
metric_names,
testing_apis=["testGetValue", "testHasValue", "testGetNumRecordedErrors"],
):
results = {x: False for x in metric_names}
for filename in root_dir.glob("**/*.kt"):
with open(filename, "r", encoding="utf8") as fd:
content = fd.read()
for category, name in metric_names:
kotlin_id = f"{util.Camelize(category)}.{util.camelize(name)}"
for api in testing_apis:
testing_id = f"{kotlin_id}.{api}"
if testing_id in content:
results[(category, name)] = True
return results
argparser = argparse.ArgumentParser(
"Determine the Glean metric testing coverage for an Android project"
)
argparser.add_argument(
"root_dir", type=str, nargs=1, help="Root directory of the project to analyse"
)
args = argparser.parse_args()
root_dir = Path(args.root_dir[0]).resolve()
metrics_files = list(
x for x in root_dir.glob("**/metrics.yaml") if "gecko" not in str(x)
)
metrics = parser.parse_objects(metrics_files)
if util.report_validation_errors(metrics):
sys.exit(1)
metric_names = set()
for category_name, category in metrics.value.items():
for metric_name, metric in category.items():
metric_names.add((category_name, metric_name))
results = find_testing_apis(metric_names)
print("category,name,tested")
for (category, name), tested in sorted(list(results.items())):
print(f"{category},{name},{tested}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment