mozilla / mozilla/probe-scraper

Hard to parse list of expired metrics in the expired metrics mails

Open
#269 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
26
Forks
73
Avg merge
10h
Merged PRs (30d)
3

Description

I'm finding it tricky to read the list of expired metrics in the mail. Here's how it reads, from a recent go 'round:

```
TIME_TO_LOAD_EVENT_END_PRELOAD_MS
TIME_TO_LOAD_EVENT_START_NO_PRELOAD_MS
blocklist.mlbf_stash_time_oldest
TIME_TO_LOAD_EVENT_END_NO_PRELOAD_MS
COOKIE_PURGING_TRACKERS_USER_INTERACTION_REMAINING_DAYS
COOKIE_PURGING_DURATION_MS
js.run_time_us
COOKIE_PURGING_TRACKERS_WITH_USER_INTERACTION
wasm.compile_time_baseline_us
COOKIE_PURGING_ORIGINS_PURGED
blocklist.lastModified_rs_addons
blocklist.lastModified_rs_plugins
TIME_TO_LOAD_EVENT_START_PRELOAD_MS
blocklist.mlbf_generation_time
blocklist.lastModified_rs_addons_mlbf
wasm.compile_time_ion_us
WEBAUTHN_GET_ASSERTION_MS
TIME_TO_FIRST_INTERACTION_PRELOAD_MS
COOKIE_PURGING_INTERVAL_HOURS
security.webauthn_used
LOAD_INPUT_EVENT_RESPONSE_NO_PRELOAD_MS
blocklist.mlbf_stashes
TIME_TO_FIRST_INTERACTION_NO_PRELOAD_MS
LOAD_INPUT_EVENT_RESPONSE_PRELOAD_MS
WEBAUTHN_CREATE_CREDENTIAL_MS
STORAGE_ACCESS_API_UI
wasm.compile_time_cranelift_us
blocklist.mlbf_stash_time_newest
blocklist.mlbf_enabled
```

First I guess we could remove the backtick fences since they're not really needed. But that's not the big problem with readability I"m having.

Could the list be lexicographically sorted? Or grouped by the bug filed? Or something? All the TIME_TO_* probes are scattered all over the place, dominating over the lowercase scalars in between. If there were a telemetry.* scalar in there (ie, one I'd have to think about), I'm not sure I'd see it.

Here's what the list looks like sorted:

COOKIE_PURGING_DURATION_MS
COOKIE_PURGING_INTERVAL_HOURS
COOKIE_PURGING_ORIGINS_PURGED
COOKIE_PURGING_TRACKERS_USER_INTERACTION_REMAINING_DAYS
COOKIE_PURGING_TRACKERS_WITH_USER_INTERACTION
LOAD_INPUT_EVENT_RESPONSE_NO_PRELOAD_MS
LOAD_INPUT_EVENT_RESPONSE_PRELOAD_MS
STORAGE_ACCESS_API_UI
TIME_TO_FIRST_INTERACTION_NO_PRELOAD_MS
TIME_TO_FIRST_INTERACTION_PRELOAD_MS
TIME_TO_LOAD_EVENT_END_NO_PRELOAD_MS
TIME_TO_LOAD_EVENT_END_PRELOAD_MS
TIME_TO_LOAD_EVENT_START_NO_PRELOAD_MS
TIME_TO_LOAD_EVENT_START_PRELOAD_MS
WEBAUTHN_CREATE_CREDENTIAL_MS
WEBAUTHN_GET_ASSERTION_MS
blocklist.lastModified_rs_addons
blocklist.lastModified_rs_addons_mlbf
blocklist.lastModified_rs_plugins
blocklist.mlbf_enabled
blocklist.mlbf_generation_time
blocklist.mlbf_stash_time_newest
blocklist.mlbf_stash_time_oldest
blocklist.mlbf_stashes
js.run_time_us
security.webauthn_used
wasm.compile_time_baseline_us
wasm.compile_time_cranelift_us
wasm.compile_time_ion_us

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect the code that generates the expired-metrics email; the issue does not name a file or test. Confirm how the metric list is assembled, then make the output easier to scan by applying the requested lexicographic ordering and checking whether the redundant code fences should be removed. Verify the resulting email against the sorted example in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.