[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•5 years ago
|
||
See bug 1584889.
Assignee | ||
Comment 2•5 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•5 years ago
|
Reporter | ||
Comment 3•5 years ago
|
||
Assignee | ||
Comment 4•5 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•5 years ago
|
||
Reporter | ||
Comment 6•5 years ago
|
||
That looked good, just known oranges.
Updated•5 years ago
|
Comment 7•5 years ago
•
|
||
Assignee | ||
Comment 8•5 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•5 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•5 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•5 years ago
|
||
Assignee | ||
Comment 12•5 years ago
|
||
Fixed review comments.
Reporter | ||
Comment 13•5 years ago
|
||
Comment 14•5 years ago
|
||
Assignee | ||
Comment 15•5 years ago
|
||
r=jorgk in commit message.
Reporter | ||
Updated•5 years ago
|
Comment 16•5 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•5 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•5 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•5 years ago
|
||
I don't think this needs to assert.
Comment 20•5 years ago
|
||
Reporter | ||
Comment 21•5 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•5 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•5 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•5 years ago
|
||
Comment 25•5 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
•