Closed
Bug 1221619
Opened 9 years ago
Closed 9 years ago
Add telemetry to memory tool
Categories
(DevTools :: Memory, defect, P3)
DevTools
Memory
Tracking
(firefox47 fixed)
RESOLVED
FIXED
Firefox 47
Tracking | Status | |
---|---|---|
firefox47 | --- | fixed |
People
(Reporter: jsantell, Assigned: fitzgen)
References
(Blocks 1 open bug)
Details
Attachments
(2 files, 1 obsolete file)
13.78 KB,
patch
|
fitzgen
:
review+
benjamin
:
feedback+
|
Details | Diff | Splinter Review |
13.80 KB,
patch
|
fitzgen
:
review+
|
Details | Diff | Splinter Review |
We have some telemetry for snapshots, but nothing for the client. We should add some things like, which breakdown presets are people using, are people inverting often, recording stacks, etc
Assignee | ||
Updated•9 years ago
|
Blocks: memory-frontend
Has STR: --- → irrelevant
Assignee | ||
Updated•9 years ago
|
Priority: -- → P3
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → nfitzgerald
Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8711910 -
Flags: review?(jsantell)
Attachment #8711910 -
Flags: review?(benjamin)
Assignee | ||
Comment 2•9 years ago
|
||
Not sure how to test telemetry data -- verified that the telemetry methods were being called via console.logs, but didn't see any of these show up in about:telemetry...
(In reply to Nick Fitzgerald [:fitzgen] [⏰PST; UTC-8] from comment #2)
> Not sure how to test telemetry data -- verified that the telemetry methods
> were being called via console.logs, but didn't see any of these show up in
> about:telemetry...
Is toolkit.telemetry.enabled true in your development profile? If not, flip it and restart. Data should then appear in about:telemetry.
Reporter | ||
Comment 4•9 years ago
|
||
Comment on attachment 8711910 [details] [diff] [review]
Add telemetry to memory tool
Review of attachment 8711910 [details] [diff] [review]:
-----------------------------------------------------------------
::: devtools/client/memory/telemetry.js
@@ +7,5 @@
> +// NB: Ensure that *every* exported function is wrapped in `makeInfallible` so
> +// that our probes don't accidentally break code that actually does productive
> +// work for the user!
> +
> +const { telemetry } = require("Services");
nit: investigate if it'd make more sense to use the devtools wrapper around telemetry (devtools/client/shared/telemetry.js)
@@ +27,5 @@
> + histogram.add(1);
> +}, "devtools/client/memory/telemetry#countExportSnapshot");
> +
> +/**
> + * @param {Boolean} inverted True if the census was inverted, false
Is there a reason these param comments are diff then the other ones in this tool? Generally the param description is on the next line, idented to the {Type}, ya?
/**
* @param {Boolean} inverted
* True if the census was inverted, false
*/
@@ +41,5 @@
> +exports.countCensus = makeInfallible(function ({ inverted, filter, diffing, breakdown }) {
> + let histogram = telemetry.getHistogramById("DEVTOOLS_MEMORY_INVERTED_CENSUS");
> + histogram.add(!!inverted);
> +
> + histogram = telemetry.getHistogramById("DEVTOOLS_MEMORY_FILTER_CENSUS");
Wouldn't DEVTOOLS_MEMORY_FILTER_CENSUS and DEVTOOLS_MEMORY_INVERTED_CENSUS both get recorded for a DIFF rather than just CENSUS? Filter isn't even implemented for diffing right now; we'd have no way to know if people are always inverting censues, but leaving diffs uninverted, for example -- not sure best way to handle that, or if it's a valid concern though
@@ +49,5 @@
> + histogram.add(!!diffing);
> +
> + histogram = telemetry.getKeyedHistogramById("DEVTOOLS_MEMORY_BREAKDOWN_CENSUS_COUNT");
> + if (breakdown === breakdowns.coarseType.breakdown) {
> + histogram.add("Coarse Type");
use const/enums for these histos
@@ +57,5 @@
> + histogram.add("Object Class");
> + } else if (breakdown === breakdowns.internalType.breakdown) {
> + histogram.add("Internal Type");
> + } else {
> + histogram.add("Other: " + JSON.stringify(breakdown));
This will be hard to get value out of it -- maybe just "Custom" here? If we want to track what kind of custom breakdowns people are using (unlikely many at all for this undocumented feature), maybe we can split it up into "features" for the breakdown? Not sure.
@@ +78,5 @@
> + histogram.add(1);
> +
> + histogram = telemetry.getKeyedHistogramById("DEVTOOLS_MEMORY_BREAKDOWN_DOMINATOR_TREE_COUNT");
> + if (breakdown === dominatorTreeBreakdowns.coarseType.breakdown) {
> + histogram.add("Coarse Type");
use const/enums for these histos
::: toolkit/components/telemetry/Histograms.json
@@ +9256,5 @@
> "low": "20000000",
> "high": "40000000",
> "n_buckets": 20
> },
> + "DEVTOOLS_MEMORY_TAKE_SNAPSHOT_COUNT": {
These should be with the other DEVTOOLS_ histograms
Attachment #8711910 -
Flags: review?(jsantell) → review+
Assignee | ||
Comment 5•9 years ago
|
||
(In reply to J. Ryan Stinnett [:jryans] (use ni?) from comment #3)
> (In reply to Nick Fitzgerald [:fitzgen] [⏰PST; UTC-8] from comment #2)
> > Not sure how to test telemetry data -- verified that the telemetry methods
> > were being called via console.logs, but didn't see any of these show up in
> > about:telemetry...
>
> Is toolkit.telemetry.enabled true in your development profile? If not, flip
> it and restart. Data should then appear in about:telemetry.
Ah, thanks! I didn't have it set for whatever reason, but now that it is set I can see the data for my new probes.
Assignee | ||
Comment 6•9 years ago
|
||
(In reply to Jordan Santell [:jsantell] [@jsantell] (Please needinfo) from comment #4)
> Comment on attachment 8711910 [details] [diff] [review]
> Add telemetry to memory tool
>
> Review of attachment 8711910 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: devtools/client/memory/telemetry.js
> @@ +7,5 @@
> > +// NB: Ensure that *every* exported function is wrapped in `makeInfallible` so
> > +// that our probes don't accidentally break code that actually does productive
> > +// work for the user!
> > +
> > +const { telemetry } = require("Services");
>
> nit: investigate if it'd make more sense to use the devtools wrapper around
> telemetry (devtools/client/shared/telemetry.js)
This seems to facilitate timing how long people are using a given tool, which is disjoint from the set of things I added probes for in this patch. I can add this measurement in another patch.
> @@ +41,5 @@
> > +exports.countCensus = makeInfallible(function ({ inverted, filter, diffing, breakdown }) {
> > + let histogram = telemetry.getHistogramById("DEVTOOLS_MEMORY_INVERTED_CENSUS");
> > + histogram.add(!!inverted);
> > +
> > + histogram = telemetry.getHistogramById("DEVTOOLS_MEMORY_FILTER_CENSUS");
>
> Wouldn't DEVTOOLS_MEMORY_FILTER_CENSUS and DEVTOOLS_MEMORY_INVERTED_CENSUS
> both get recorded for a DIFF rather than just CENSUS?
Yes, that was intentional.
> Filter isn't even
> implemented for diffing right now;
Filtering is implemented for diffing.
> we'd have no way to know if people are
> always inverting censues, but leaving diffs uninverted, for example -- not
> sure best way to handle that, or if it's a valid concern though
This is true, but I'm not sure that it matters a ton.
> @@ +57,5 @@
> > + histogram.add("Object Class");
> > + } else if (breakdown === breakdowns.internalType.breakdown) {
> > + histogram.add("Internal Type");
> > + } else {
> > + histogram.add("Other: " + JSON.stringify(breakdown));
>
> This will be hard to get value out of it -- maybe just "Custom" here? If we
> want to track what kind of custom breakdowns people are using (unlikely many
> at all for this undocumented feature), maybe we can split it up into
> "features" for the breakdown? Not sure.
Yeah, I was on the fence too. I guess it will be interesting just to see if anyone uses custom breakdowns at all (how would they even know they can?)
> > + "DEVTOOLS_MEMORY_TAKE_SNAPSHOT_COUNT": {
>
> These should be with the other DEVTOOLS_ histograms
They are with the other DEVTOOLS_* histograms, at the bottom of them.
Assignee | ||
Comment 7•9 years ago
|
||
Attachment #8712401 -
Flags: review?(benjamin)
Attachment #8712401 -
Flags: review+
Assignee | ||
Updated•9 years ago
|
Attachment #8711910 -
Attachment is obsolete: true
Attachment #8711910 -
Flags: review?(benjamin)
Assignee | ||
Comment 8•9 years ago
|
||
(In reply to Nick Fitzgerald [:fitzgen] [⏰PST; UTC-8] from comment #6)
> (In reply to Jordan Santell [:jsantell] [@jsantell] (Please needinfo) from
> > nit: investigate if it'd make more sense to use the devtools wrapper around
> > telemetry (devtools/client/shared/telemetry.js)
>
> This seems to facilitate timing how long people are using a given tool,
> which is disjoint from the set of things I added probes for in this patch. I
> can add this measurement in another patch.
We already seem to have this in place now for the memory tool, so I don't think another patch is needed.
Comment 9•9 years ago
|
||
Comment on attachment 8712401 [details] [diff] [review]
Add telemetry to memory tool
data-review=me
Attachment #8712401 -
Flags: review?(benjamin) → feedback+
Assignee | ||
Comment 10•9 years ago
|
||
Change commit message to reflect r=jsantell and data-review=bsmedberg
Attachment #8715539 -
Flags: review+
Assignee | ||
Comment 11•9 years ago
|
||
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Comment 12•9 years ago
|
||
Keywords: checkin-needed
Comment 13•9 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox47:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 47
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•