Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix probe recording range display #543

Merged
merged 4 commits into from
May 21, 2018
Merged

Fix probe recording range display #543

merged 4 commits into from
May 21, 2018

Conversation

georgf
Copy link
Contributor

@georgf georgf commented May 10, 2018

tdsmith found an issue with the shown recording in the probe-dictionary.
Investigating this it turned out to be a problem with the frontend.

The changes are up for testing here.

@tdsmith
Copy link

tdsmith commented May 10, 2018

Thanks! Looking at DEVTOOLS_TOOLBOX_TIME_ACTIVE_SECONDS, I wonder if reporting it as "release from 30" is the right presentation; it became an opt-out metric in release for 60.

@tdsmith
Copy link

tdsmith commented May 10, 2018

(The original issue with the _COUNT probe looks good now!)

@georgf
Copy link
Contributor Author

georgf commented May 17, 2018

Good catch!

I addressed that, but now DEVTOOLS_TOOLBOX_TIME_ACTIVE_SECONDS is showing up as recorded from 59 on release.

This seems to actually come from the source data, i.e. probe-scraper.

@georgf
Copy link
Contributor Author

georgf commented May 17, 2018

I found another example where recording ranges are off, telemetry.discarded.child_events.
This is also a problem in the source data.

Per 1369041 this probe should be on 56+ and not be on 55 for release & beta.

@georgf
Copy link
Contributor Author

georgf commented May 17, 2018

@tdsmith Can you take a look, with that issue in mind?
I'll probably wrap up this frontend issue and take the rest to a separate backend issue.

@tdsmith
Copy link

tdsmith commented May 17, 2018

Hmm, sorry to nitpick, but the table view in the staging version lists expired prerelease probes as "recorded: never" now.

Compare the "recorded" columns:
https://georgf.github.io/telemetry-dashboard/probe-dictionary/?search=devtools_toolb vs https://telemetry.mozilla.org/probe-dictionary/?search=devtools_toolb

@tdsmith
Copy link

tdsmith commented May 17, 2018

DOM_TIMERS_* are another interesting set of probes; they're currently displayed as recorded from "46 to 39" on t.m.o

@georgf
Copy link
Contributor Author

georgf commented May 18, 2018

Good catches, cheers!
I fixed those and pushed an update.
DOM_TIMERS_* and DEVTOOLS_TOOLBOX_* seem ok.

@tdsmith Do you want to take another look?

@tdsmith
Copy link

tdsmith commented May 18, 2018

Looking great!

@georgf georgf requested a review from Dexterp37 May 18, 2018 18:02
Copy link
Contributor

@Dexterp37 Dexterp37 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me! Consider adding the comments where requested below, but don't block on this if you don't have time right now. It's something that would make it easier for other readers in the future, but doesn't need to happen in this bug, as it's a project-wide effort!

function friendlyRecordingRange(firstVersion, expiry) {
if (expiry == "never") {
return `from ${firstVersion}`;
function friendlyRecordingRangeForHistory(history, channel, filterPrerelease) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reads much better now! I wish this was just a little more documented, as it's still difficult to parse after not looking at this for a while.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point, i will add some.

function friendlyRecordingRangeForHistory(history, channel, filterPrerelease) {
const last = array => array[array.length - 1];

if ((channel == "release") && filterPrerelease) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment nit: why is this fixup needed? That's for bridging the optout/optin to the prerelease/release definitions, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the "release" channel we only want to account for the release probes. The most readable approach seems to just filter out the history parts we don't want to account for.

This is only used for the detail view though; in the search results view we want different behavior - hence the filterPrerelease flag.

const expiry = state.expiry_version;
return friendlyRecordingRange(firstVersion, expiry);
}
if (history.length == 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we returning "never" if there's no history? Shouldn't this just be the case for expiry == "never"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The prior filter statement can result in an empty history (consider prerelease-only probes on "release" channel).
That should result in a "never" recording range on that channel.

@@ -461,7 +471,7 @@ function renderMeasurements(measurements) {
["name", (d, h, c) => d.name],
["type", (d, h, c) => d.type],
["population", (d, h, c) => h.optout ? "release" : "prerelease"],
["recorded", (d, h, c, history) => friendlyRecordingRangeForHistory(history, c)],
["recorded", (d, h, c, history) => friendlyRecordingRangeForHistory(history, c, false)],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: should we add /* filterPrelrease */ after false? It would make it easier to understand without having tor scroll the file back to the function definition

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes these lines pretty long though, i'm torn on that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to drop this and the one below!

@@ -843,7 +853,7 @@ function showDetailViewForId(probeId, channel=$("#select_channel").val()) {
if ((!history[0].optout && (ch == "release")) || (ch == "aurora")) {
continue;
}
rangeText.push(`${ch} ${friendlyRecordingRangeForHistory(history, ch)}`);
rangeText.push(`${ch} ${friendlyRecordingRangeForHistory(history, ch, true)}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: same here, but only if it works in the ` :)

@georgf georgf merged commit ec1f73e into mozilla:gh-pages May 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants