[Thunderbird Telemetry] collect type of composition: new/reply/fwd/edit draft etc.
Categories
(Thunderbird :: Message Compose Window, task)
Tracking
(Not tracked)
People
(Reporter: mkmelin, Assigned: rnons)
Details
Attachments
(2 files, 4 obsolete files)
3.64 KB,
patch
|
rnons
:
review+
|
Details | Diff | Splinter Review |
3.15 KB,
patch
|
jorgk-bmo
:
review+
|
Details | Diff | Splinter Review |
To understand the typical usage pattern of our users, it would be interesting to collect what composition type is: new/reply/forward/draft etc.
Reporter | ||
Comment 1•4 years ago
|
||
See bug 1584889.
Assignee | ||
Comment 2•4 years ago
|
||
This patch
- defined
TB_COMPOSE_TYPE
as categorical type inHistograms.json
- use
Telemetry::Accumulate
inngMsgCompose.cpp
The report I get from gzipServer seems alright
"TB_COMPOSE_TYPE": {
"bucket_count": 51,
"histogram_type": 5,
"sum": 12,
"range": [
1,
50
],
"values": {
"5": 0,
"6": 2,
"7": 0
}
}
But the test is failing with
Unexpected Results
------------------
comm/mailnews/compose/test/unit/test_telemetry_compose.js
FAIL test_compose_type - [test_compose_type : 304] Should have found an entry for TB_COMPOSE_TYPE at index 0 - false == true
resource://testing-common/TelemetryTestUtils.jsm:assertHistogram:304
I tried to print out Services.telemetry.getHistogramById('TB_COMPOSE_TYPE')
, but get an empty object.
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Comment 3•4 years ago
|
||
Comment on attachment 9150059 [details] [diff] [review] 1615996.patch Review of attachment 9150059 [details] [diff] [review]: ----------------------------------------------------------------- ::: mailnews/compose/test/unit/test_telemetry_compose.js @@ +90,5 @@ > + createCompose(Ci.nsIMsgCompType.ReplyIgnoreQuote); > + } > + > + // Did we count them correctly? > + const histogram = TelemetryTestUtils.getAndClearHistogram("TB_COMPOSE_TYPE"); note the name of that: get AND clear. So you'll always get an empty object. I think you want to get it before you do all the calls, then, looks like histogram.snapshot() will be what you want?
Assignee | ||
Comment 4•4 years ago
|
||
Yes, you're right, I moved getAndClearHistogram
above. Also found assertHistogram
is not what I want, it tries to test other buckets are empty, not sure why is it designed that way.
https://searchfox.org/mozilla-central/source/toolkit/components/telemetry/tests/utils/TelemetryTestUtils.jsm#296-301
Tests pass now, thank you.
Reporter | ||
Comment 5•4 years ago
|
||
Comment on attachment 9150073 [details] [diff] [review] 1615996.patch Review of attachment 9150073 [details] [diff] [review]: ----------------------------------------------------------------- Looks good, thx! r=mkmelin I've sent it off to the try server for you now to make sure: https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=4e8bc41b751c87f0a5d72029213e7f483615e80f
Reporter | ||
Comment 6•4 years ago
|
||
That looked good, just known oranges.
Updated•4 years ago
|
Comment 7•4 years ago
•
|
||
Comment on attachment 9150073 [details] [diff] [review] 1615996.patch This isn't right. ReplyIgnoreQuote is not a compose type. Please check its definition and use.
Assignee | ||
Comment 8•4 years ago
|
||
(In reply to Jorg K (CEST = GMT+2) from comment #7)
Comment on attachment 9150073 [details] [diff] [review]
1615996.patchThis isn't right. ReplyIgnoreQuote is not a compose type. Please check its
definition and use.
Thanks, didn't know about that. Please see if it's better now.
Reporter | ||
Comment 9•4 years ago
|
||
Ugh, that's just so wrong. I filed bug 1639452. In this bug I think all that needs to be done is removing that type.
Assignee | ||
Comment 10•4 years ago
|
||
(In reply to Magnus Melin [:mkmelin] from comment #9)
Ugh, that's just so wrong. I filed bug 1639452. In this bug I think all that needs to be done is removing that type.
Hi, just making sure, do you mean all I need to do now is removing this test?
Assert.equal(
snapshot.values[Ci.nsIMsgCompType.ReplyIgnoreQuote],
undefined,
"nsIMsgCompType.ForwardInline count must be correct"
);
Reporter | ||
Comment 11•4 years ago
|
||
Comment on attachment 9150336 [details] [diff] [review] 1615996.patch Review of attachment 9150336 [details] [diff] [review]: ----------------------------------------------------------------- ::: mailnews/compose/test/unit/test_telemetry_compose.js @@ +105,5 @@ > + ); > + Assert.equal( > + snapshot.values[Ci.nsIMsgCompType.EditTemplate], > + NUM_EDIT_TEMPLATE, > + "nsIMsgCompType.ReplyIgnoreQuote count must be correct" yes, and this should be EditTemplate
Assignee | ||
Comment 12•4 years ago
|
||
Fixed review comments.
Reporter | ||
Comment 13•4 years ago
|
||
Comment on attachment 9150364 [details] [diff] [review] 1615996.patch Review of attachment 9150364 [details] [diff] [review]: ----------------------------------------------------------------- Looks good, thx.
Comment 14•4 years ago
|
||
Comment on attachment 9150364 [details] [diff] [review] 1615996.patch Review of attachment 9150364 [details] [diff] [review]: ----------------------------------------------------------------- Looks OK now, r=jorgk (not jorg). I checked that ReplyIgnoreQuote is pretty short-lived, it gets removed here https://searchfox.org/comm-central/rev/cfa832291ae06d6b814f8a9ebe1991a08f25da92/mailnews/compose/src/nsMsgComposeService.cpp#357 and doesn't get to where you're reporting the compose type.
Assignee | ||
Comment 15•4 years ago
|
||
r=jorgk in commit message.
Reporter | ||
Updated•4 years ago
|
Comment 16•4 years ago
|
||
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/ba49bdd5e52c
Add telemetry to count use of message compose type. r=mkmelin,jorgk DONTBUILD
Comment 17•4 years ago
|
||
The debug test runs did not like this:
TEST-UNEXPECTED-FAIL | comm/mailnews/compose/test/unit/test_telemetry_compose.js | xpcshell return code: -11
PROCESS-CRASH | comm/mailnews/compose/test/unit/test_telemetry_compose.js | application crashed [@ nsMsgCompose::CreateMessage(char const*, int, nsIMsgCompFields*)]
Example log: https://treeherder.mozilla.org/logviewer.html#?job_id=303311380&repo=comm-central
Reporter | ||
Comment 18•4 years ago
|
||
[18975, Main Thread] ###!!! ASSERTION: CreateMessage can't get draft id: 'NS_SUCCEEDED(rv) && !curDraftIdURL.IsEmpty()', file /builds/worker/checkouts/gecko/comm/mailnews/compose/src/nsMsgCompose.cpp, line 1752
Reporter | ||
Comment 19•4 years ago
|
||
I don't think this needs to assert.
Comment 20•4 years ago
|
||
Comment on attachment 9150969 [details] [diff] [review] bug1615996_draft_assert.patch You should just set a draft ID in your test instead of modifying the backend. Why is it a good idea to to change established code just because a new test is incomplete? And why don't you run those tests locally in a debug build before landing them?
Reporter | ||
Comment 21•4 years ago
|
||
Since all the code around where I'm changing it already has code comments that make it clear this is an expected - but perhaps not common case - asserting about it makes no sense. Just adding a fake id would just produce further warnings in debug builds - so that does little to improve matters.
Comment 22•4 years ago
•
|
||
Just adding a fake id would just produce further warnings in debug builds
Which? Have you tried?
let composeFields = Cc[
"@mozilla.org/messengercompose/composefields;1"
].createInstance(Ci.nsIMsgCompFields);
composeFields.draftId = "XXX";
params.composeFields = composeFields;
is all you need.
EDIT: Makes the test more life-like. You could also set params.format = Ci.nsIMsgCompFormat.Default;
.
Reporter | ||
Comment 23•4 years ago
|
||
All that would do is get you into the next assertion a few lines down "CreateMessage can't get msg header DB interface pointer." - which is kind of a valid assertion given we did go down that if-clause.
Comment 24•4 years ago
|
||
Comment on attachment 9150969 [details] [diff] [review] bug1615996_draft_assert.patch OK then ;-)
Comment 25•4 years ago
|
||
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/6a077945683b
don't assert for missing draftid - warn only. r=jorgk DONTBUILD
Description
•