Created
March 18, 2021 19:57
-
-
Save wlach/059d21eb9232643710b30e0e103b3bdf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "cells": [ | |
| { | |
| "cell_type": "code", | |
| "execution_count": 47, | |
| "id": "decreased-swing", | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [ | |
| "import requests\n", | |
| "import json" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 49, | |
| "id": "medium-answer", | |
| "metadata": {}, | |
| "outputs": [ | |
| { | |
| "name": "stdout", | |
| "output_type": "stream", | |
| "text": [ | |
| "https://probeinfo.telemetry.mozilla.org/glean/glean-core/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/glean-core/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/glean-android/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/glean-android/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/glean/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/glean/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/glean-deprecated/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/glean-deprecated/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/lib-crash/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/lib-crash/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/sync/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/sync/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/engine-gecko/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/engine-gecko/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/engine-gecko-beta/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/engine-gecko-beta/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/engine-gecko-nightly/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/engine-gecko-nightly/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/logins-store/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/logins-store/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/support-migration/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/support-migration/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/android-places/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/android-places/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/glean-js/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/glean-js/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/firefox-desktop/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/firefox-desktop/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/firefox-android-release/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/firefox-android-release/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/firefox-android-beta/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/firefox-android-beta/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/fenix/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/fenix/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/fenix-nightly/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/fenix-nightly/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/firefox-android-nightly/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/firefox-android-nightly/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/firefox-ios-release/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/firefox-ios-release/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/firefox-ios-beta/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/firefox-ios-beta/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/firefox-ios-dev/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/firefox-ios-dev/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/reference-browser/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/reference-browser/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/firefox-for-fire-tv/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/firefox-for-fire-tv/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/firefox-reality/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/firefox-reality/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/lockwise-android/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/lockwise-android/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/lockwise-ios/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/lockwise-ios/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/mozregression/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/mozregression/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/burnham/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/burnham/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/mozphab/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/mozphab/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/firefox-for-echo-show/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/firefox-for-echo-show/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/firefox-reality-pc/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/firefox-reality-pc/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/mach/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/mach/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/firefox-focus-ios/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/firefox-focus-ios/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/firefox-klar-ios/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/firefox-klar-ios/metrics\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/bergamot/pings\n", | |
| "https://probeinfo.telemetry.mozilla.org/glean/bergamot/metrics\n" | |
| ] | |
| } | |
| ], | |
| "source": [ | |
| "source_urls = {}\n", | |
| "repos = requests.get(\"https://probeinfo.telemetry.mozilla.org/glean/repositories\").json()\n", | |
| "#repos = json.load(open('repositories-formatted-new.json'))\n", | |
| "for repo in repos:\n", | |
| " for objtype in ('pings', 'metrics'):\n", | |
| " print(\"https://probeinfo.telemetry.mozilla.org/glean/{}/{}\".format(repo['name'], objtype))\n", | |
| " objs = requests.get(\"https://probeinfo.telemetry.mozilla.org/glean/{}/{}\".format(repo['name'], objtype)).json()\n", | |
| " for obj in objs.values():\n", | |
| " for hist_entry in obj['history']:\n", | |
| " if not source_urls.get(repo['name']):\n", | |
| " source_urls[repo['name']] = []\n", | |
| " source_urls[repo['name']].append(hist_entry['source_url'])" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 50, | |
| "id": "suffering-transport", | |
| "metadata": {}, | |
| "outputs": [ | |
| { | |
| "name": "stdout", | |
| "output_type": "stream", | |
| "text": [ | |
| "('glean-core', {'glean-core/metrics.yaml', 'glean-core/pings.yaml'})\n", | |
| "('glean-android', {'glean-core/android/metrics.yaml', 'glean-core/metrics.yaml', 'glean-core/pings.yaml'})\n", | |
| "('glean', {'glean-core/android/metrics.yaml', 'glean-core/metrics.yaml', 'glean-core/pings.yaml'})\n", | |
| "('glean-deprecated', {'glean-core/android/metrics.yaml', 'glean-core/metrics.yaml', 'glean-core/pings.yaml'})\n", | |
| "('lib-crash', {'components/lib/crash/metrics.yaml'})\n", | |
| "('sync', {'components/support/sync-telemetry/metrics.yaml', 'components/support/sync-telemetry/pings.yaml'})\n", | |
| "('engine-gecko', {'toolkit/components/telemetry/geckoview/streaming/metrics.yaml'})\n", | |
| "('engine-gecko-beta', {'toolkit/components/telemetry/geckoview/streaming/metrics.yaml'})\n", | |
| "('engine-gecko-nightly', {'toolkit/components/telemetry/geckoview/streaming/metrics.yaml'})\n", | |
| "('logins-store', {'components/logins/android/metrics.yaml'})\n", | |
| "('support-migration', {'components/support/migration/metrics.yaml', 'components/support/migration/pings.yaml'})\n", | |
| "('android-places', {'components/places/android/metrics.yaml'})\n", | |
| "('glean-js', {'glean/src/pings.yaml'})\n", | |
| "('firefox-desktop', {'toolkit/components/glean/metrics.yaml', 'toolkit/components/glean/pings.yaml'})\n", | |
| "('firefox-android-release', {'app/pings.yaml', 'app/metrics.yaml'})\n", | |
| "('firefox-android-beta', {'app/pings.yaml', 'app/metrics.yaml'})\n", | |
| "('fenix', {'app/pings.yaml', 'app/metrics.yaml'})\n", | |
| "('fenix-nightly', {'app/pings.yaml', 'app/metrics.yaml'})\n", | |
| "('firefox-android-nightly', {'app/pings.yaml', 'app/metrics.yaml'})\n", | |
| "('firefox-ios-release', {'Client/metrics.yaml'})\n", | |
| "('firefox-ios-beta', {'Client/metrics.yaml'})\n", | |
| "('firefox-ios-dev', {'Client/metrics.yaml'})\n", | |
| "('reference-browser', {'app/metrics.yaml'})\n", | |
| "('firefox-for-fire-tv', {'app/metrics.yaml'})\n", | |
| "('firefox-reality', {'app/pings.yaml', 'app/metrics.yaml'})\n", | |
| "('lockwise-android', {'app/metrics.yaml'})\n", | |
| "('mozregression', {'mozregression/metrics.yaml', 'mozregression/pings.yaml'})\n", | |
| "('burnham', {'application/src/burnham/config/metrics.yaml', 'application/src/burnham/config/pings.yaml'})\n", | |
| "('mozphab', {'mozphab/pings.yaml', 'mozphab/metrics.yaml'})\n", | |
| "('firefox-for-echo-show', {'app/metrics.yaml'})\n", | |
| "('firefox-reality-pc', {'Source/FirefoxRealityUnity/pings.yaml', 'Source/FirefoxRealityUnity/metrics.yaml'})\n", | |
| "('mach', {'python/mach/metrics.yaml', 'python/mach/pings.yaml'})\n", | |
| "('firefox-focus-ios', {'Blockzilla/metrics.yaml'})\n", | |
| "('firefox-klar-ios', {'Blockzilla/metrics.yaml'})\n", | |
| "('bergamot', {'src/core/ts/background-scripts/background.js/telemetry/metrics.yaml', 'src/core/ts/background-scripts/background.js/telemetry/pings.yaml'})\n" | |
| ] | |
| } | |
| ], | |
| "source": [ | |
| "import re\n", | |
| "\n", | |
| "for repo_name, source_urls in source_urls.items():\n", | |
| " unique_paths = set(\n", | |
| " re.sub(r'.*blob\\/\\w+/(.*)\\#L[0-9]+', r'\\1', source_url) for source_url in source_urls\n", | |
| " )\n", | |
| " print((repo_name, unique_paths))" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "id": "proper-american", | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [] | |
| } | |
| ], | |
| "metadata": { | |
| "kernelspec": { | |
| "display_name": "Python 3", | |
| "language": "python", | |
| "name": "python3" | |
| }, | |
| "language_info": { | |
| "codemirror_mode": { | |
| "name": "ipython", | |
| "version": 3 | |
| }, | |
| "file_extension": ".py", | |
| "mimetype": "text/x-python", | |
| "name": "python", | |
| "nbconvert_exporter": "python", | |
| "pygments_lexer": "ipython3", | |
| "version": "3.8.6" | |
| } | |
| }, | |
| "nbformat": 4, | |
| "nbformat_minor": 5 | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment