Closed
Bug 1359065
Opened 8 years ago
Closed 8 years ago
Message repeat shouldn't check timestamp
Categories
(DevTools :: Console, defect, P1)
DevTools
Console
Tracking
(firefox55 verified)
| Tracking | Status | |
|---|---|---|
| firefox55 | --- | verified |
People
(Reporter: nchevobbe, Assigned: Honza)
References
Details
(Whiteboard: [console-html])
Attachments
(3 files)
STR :
1. Open the console
2. In jsterm, add the following event listener which logs "mouse" on each mousemove :
document.addEventListener("mousemove", e => console.log("mouse"))
3. Move your cursor across the screen
ER : One "mouse" message is logged, and then the repeat icon number grows (like in the old console)
AR : One "mouse" message is logged for each event.
----
This is happening because in order to check if a message is the same as the previous one, we stringify the whole message (see http://searchfox.org/mozilla-central/source/devtools/client/webconsole/new-console-output/utils/messages.js#221-224). The problem with this approach is that messages have a `timestamp` property, which is likely to be different for each messages, even if they look alike.
We might revisit how we generate this repeatId, first because it's incorrect, and second because it is not really efficient (the transform from an Immutable.Record to a plain object is costly)
| Reporter | ||
Updated•8 years ago
|
Updated•8 years ago
|
Flags: qe-verify?
Priority: P1 → P2
| Assignee | ||
Updated•8 years ago
|
Assignee: nobody → odvarko
Status: NEW → ASSIGNED
Updated•8 years ago
|
Iteration: --- → 55.4 - May 1
Priority: P2 → P1
| Comment hidden (mozreview-request) |
| Assignee | ||
Comment 2•8 years ago
|
||
I have been testing how much time is spent in getRepeatId() method using peformance.now() and summing up all values for 1K messages. I am getting 30-80 ms time spent in that method for 1K messages (depending on log size).
So, I also agree that we can just keep that methods as is (at least for now).
Patch attached for review.
Honza
| Reporter | ||
Comment 3•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8862354 [details]
Bug 1359065 - Remove timeStamp before generating message ID;
https://reviewboard.mozilla.org/r/134280/#review137302
Looks enough for now.
Could you edit the existing mocha tests to make sure this is fixed :
- http://searchfox.org/mozilla-central/source/devtools/client/webconsole/new-console-output/test/utils/getRepeatId.test.js
- http://searchfox.org/mozilla-central/source/devtools/client/webconsole/new-console-output/test/store/messages.test.js#42
We should set a different timestamp on the second messages of both tests, and they should have the same repeatId
Attachment #8862354 -
Flags: review?(nchevobbe) → review+
Updated•8 years ago
|
Flags: qe-verify? → qe-verify+
QA Contact: iulia.cristescu
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Reporter | ||
Comment 6•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8862733 [details]
Bug 1359065 - Update tests;
https://reviewboard.mozilla.org/r/134600/#review137588
Looks good !
I think we should run the mochitest to update http://searchfox.org/mozilla-central/source/devtools/client/webconsole/new-console-output/test/fixtures/stubs/cssMessage.js , http://searchfox.org/mozilla-central/source/devtools/client/webconsole/new-console-output/test/fixtures/stubs/evaluationResult.js and http://searchfox.org/mozilla-central/source/devtools/client/webconsole/new-console-output/test/fixtures/stubs/pageError.js since they have a repeatId which contains the timeStamp too.
::: devtools/client/webconsole/new-console-output/test/utils/getRepeatId.test.js:12
(Diff revision 1)
> - const message1 = stubPreparedMessages.get("console.log('foobar', 'test')");
> - const message2 = message1.set("repeat", 3);
> + var message1 = stubPreparedMessages.get("console.log('foobar', 'test')");
> + var message2 = message1.set("repeat", 3);
> +
> + // Repeat ID must be the same even if the timestamp is different.
> + message1 = message1.set("timeStamp", 1,);
> + message2 = message2.set("timeStamp", 2,);
not: I don't think we need to set the "repeat" property here, and maybe we can improve things a bit like :
```
const baseMessage = stubPreparedMessages.get("console.log('foobar', 'test')");
// Repeat ID must be the same even if the timestamp is different.
const message1 = baseMessage.set("timeStamp", 1);
const message2 = baseMessage.set("timeStamp", 2);
```
Attachment #8862733 -
Flags: review?(nchevobbe) → review+
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Assignee | ||
Comment 9•8 years ago
|
||
Nicolas, do you see any perf improvement if the code looks like as follows?
// Do not use 'delete'
function getRepeatId(message) {
message = message.toJS();
message.repeat = null;
message.timeStamp = null;
return JSON.stringify(message);
}
Honza
Flags: needinfo?(nchevobbe)
Updated•8 years ago
|
Iteration: 55.4 - May 1 → 55.5 - May 15
| Reporter | ||
Comment 10•8 years ago
|
||
(In reply to Jan Honza Odvarko [:Honza] from comment #9)
> Nicolas, do you see any perf improvement if the code looks like as follows?
>
> // Do not use 'delete'
> function getRepeatId(message) {
> message = message.toJS();
> message.repeat = null;
> message.timeStamp = null;
> return JSON.stringify(message);
> }
>
>
> Honza
Definitely (saves ~30ms)
Flags: needinfo?(nchevobbe)
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Assignee | ||
Comment 13•8 years ago
|
||
(In reply to Nicolas Chevobbe [:nchevobbe] from comment #10)
> Definitely (saves ~30ms)
Great, patch updated.
Honza
| Comment hidden (mozreview-request) |
| Reporter | ||
Comment 15•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8863994 [details]
Bug 1359065 - Update stubs;
https://reviewboard.mozilla.org/r/135720/#review138744
Attachment #8863994 -
Flags: review?(nchevobbe) → review+
Comment 16•8 years ago
|
||
Pushed by jodvarko@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e9e7ef4f6e99
Remove timeStamp before generating message ID; r=nchevobbe
https://hg.mozilla.org/integration/autoland/rev/66d3d14f9d9d
Update tests; r=nchevobbe
https://hg.mozilla.org/integration/autoland/rev/a63f99f00b49
Update stubs; r=nchevobbe
Comment 17•8 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/e9e7ef4f6e99
https://hg.mozilla.org/mozilla-central/rev/66d3d14f9d9d
https://hg.mozilla.org/mozilla-central/rev/a63f99f00b49
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 55
Comment 18•8 years ago
|
||
Managed to reproduce the initial issue on 55.0a1 (2017-05-02), using Windows 10 x64, Ubuntu 16.04 x64 and Mac OS X 10.11.6. I can confirm that 55.0a1 (2017-05-17) build is verified fixed on the above platforms.
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•