Highlight all the associate flow events for an input event
BUG=#948
R=nduca@chromium.org
Committed: https://chromium.googlesource.com/external/trace-viewer/+/202afe717e19c4cda9614bf79a6d83c3d4e2a5ba
unit test plox https://codereview.appspot.com/237520043/diff/1/trace_viewer/extras/chrome/cc/input_latency_async_slice.html File trace_viewer/extras/chrome/cc/input_latency_async_slice.html (right): https://codereview.appspot.com/237520043/diff/1/trace_viewer/extras/chrome/cc/input_latency_async_slice.html#newcode29 trace_viewer/extras/chrome/cc/input_latency_async_slice.html:29: var associatedEvents = []; should we ...
8 years, 11 months ago
(2015-05-27 01:26:24 UTC)
#2
> Can I just edit trace_model itself? I am afraid of conflict, etc. yes, we ...
8 years, 11 months ago
(2015-05-27 17:44:45 UTC)
#5
> Can I just edit trace_model itself? I am afraid of conflict, etc.
yes, we can.
probably you want a new step right before "run audits" in trace_model importer
that calls buildIndices_() function, then have that build indices. happy to chat
in person.
On 2015/05/27 17:44:45, nduca wrote: Now flowEventsIndexMap is just a local variable in trace_model. Do ...
8 years, 11 months ago
(2015-05-27 21:03:36 UTC)
#6
On 2015/05/27 17:44:45, nduca wrote:
Now flowEventsIndexMap is just a local variable in trace_model. Do you think it
makes more sense to create a standalone class for it, and then new it in
trace_model, just like how flowIntervalTree is handled now? If so, do you think
it should be a base class or just within the trace_model directory?
https://codereview.appspot.com/237520043/diff/80001/trace_viewer/core/trace_model/trace_model.html File trace_viewer/core/trace_model/trace_model.html (left): https://codereview.appspot.com/237520043/diff/80001/trace_viewer/core/trace_model/trace_model.html#oldcode15 trace_viewer/core/trace_model/trace_model.html:15: <link rel="import" href="/core/importer/empty_importer.html"> you should modify an existing set ...
8 years, 10 months ago
(2015-05-28 03:10:56 UTC)
#9
https://codereview.appspot.com/237520043/diff/80001/trace_viewer/core/trace_m...
File trace_viewer/core/trace_model/trace_model.html (left):
https://codereview.appspot.com/237520043/diff/80001/trace_viewer/core/trace_m...
trace_viewer/core/trace_model/trace_model.html:15: <link rel="import"
href="/core/importer/empty_importer.html">
you should modify an existing set of basic test in trace_model_test to assert
that model.indices is not undefined.
https://codereview.appspot.com/237520043/diff/80001/trace_viewer/core/trace_m...
File trace_viewer/core/trace_model/trace_model_indices.html (right):
https://codereview.appspot.com/237520043/diff/80001/trace_viewer/core/trace_m...
trace_viewer/core/trace_model/trace_model_indices.html:32: }, this);
this file should have a _test file that makes a model with a pair of flow events
with the same id.
test1: tests that the getFlowEventsWithId returns the right thing when you ask
it for that flow event id
test2: tests that getFlowEventsWithId returns [] when you ask for an unindexed
id
https://codereview.appspot.com/237520043/diff/80001/trace_viewer/core/trace_m...
trace_viewer/core/trace_model/trace_model_indices.html:44: if
(!this.flowEventsById_.hasOwnProperty(id))
we prefer this style:
if (x)
return y
return z
where the else clause simply isn't indented. this way the z case doesn't
indented, so when you start chaining if statements you don't burn your 80col
limit too fast.
https://codereview.appspot.com/237520043/diff/80001/trace_viewer/extras/chrom...
File trace_viewer/extras/chrome/cc/input_latency_async_slice_test.html (right):
https://codereview.appspot.com/237520043/diff/80001/trace_viewer/extras/chrom...
trace_viewer/extras/chrome/cc/input_latency_async_slice_test.html:103:
m.flowEventsIndices = new tv.c.trace_model.TraceModelIndices(m);
you should not be populating the index directly.
you should be doing
var m = test_utils.newModel(function(m) {
m.a = create async slice with same id and add to model
m.flow1 = create flow event with same id and add to model
});
assertEquals(m.a.associatedEvents, [m.flow1])
for instance. this way the events and model are created as they are done in
production, via the importEvents flow. the way you are doing it, you are
creating events in potentially different way than the import flow does it. this
means that if we change the way we do the import flow, this test could break.
Issue 237520043: Highlight all the associate flow events for an input event
(Closed)
Created 8 years, 11 months ago by yuhaoz
Modified 8 years, 10 months ago
Reviewers: nduca, benjhayden
Base URL: git@github.com:google/trace-viewer.git@master
Comments: 21