Skip to content

Instantly share code, notes, and snippets.

@wlach
Last active June 21, 2021 19:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wlach/035255e31a0e8eb75f5d1c624ffcd7df to your computer and use it in GitHub Desktop.
Save wlach/035255e31a0e8eb75f5d1c624ffcd7df to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# Example of this script in action: https://github.com/mozilla/glean-annotations/pull/44
# Meant to be run in the `annotations/fenix/metrics` directory
import os
import requests
metrics = requests.get('https://probeinfo.telemetry.mozilla.org/glean/fenix/metrics').json()
for metric_name in metrics.keys():
if metric_name.startswith('perf.'):
os.makedirs(metric_name, exist_ok=True)
open(os.path.join(metric_name, "README.md"), 'w').write(f"""---
tags:
- Performance
---
This is a stub commentary for the `{metric_name}` metric: please feel free to edit (read the
[contributing guidelines](https://github.com/mozilla/glean-annotations/blob/main/CONTRIBUTING.md)
if you haven't done this before)
""")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment