Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add upper limit truncation for each load of trace viewer #608

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions plugin/trace_viewer/tf_trace_viewer/tf-trace-viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@
_model: Object,
_resolution: {type: Number, value: 1000},
_filteredByVisibility: {type: Boolean, value: false},
_traceEventsCapped: {type: Boolean, value: false},
_dataRegenerated: {type: Boolean, value: false},
_isInitialLoad: {type: Boolean, value: true},
_replaceModel: {type: Boolean, value: true},
Expand Down Expand Up @@ -539,6 +540,15 @@
this._loadTrace(null, /* replaceModel= */ true);
},

_popRenderAlerts: function () {
if (this._traceEventsCapped) {
this._displayOverlay(
"Trace Viewer",
"Please be aware that the events has been truncated to avoid crash. If you want to have a complete view, please try approaches (eg. Zoom in, filter..etc) to scope down the trace to explore."
);
}
},

_loadTrace: async function(requestedRange, replaceModel) {
this._replaceModel = replaceModel;
const startTime = performance.now();
Expand Down Expand Up @@ -571,6 +581,7 @@
'event_label': 'trace_viewer_reloading',
});
}
this._popRenderAlerts();
this._insertRenderCompleteSignal();
},

Expand Down Expand Up @@ -752,6 +763,7 @@
this._model = new tr.Model();
this._loadedTraceEvents = new Set();
this._filteredByVisibility = data['filteredByVisibility'];
this._traceEventsCapped = data['traceEventsCapped'];
const fullTimespan = data['fullTimespan'];
this._fullBounds = {min: fullTimespan[0], max: fullTimespan[1]};
this._tasks = data['tasks'];
Expand Down