Skip to content

Commit

Permalink
Set default value for useNewBackend to true. This CL is a no-op in Te…
Browse files Browse the repository at this point in the history
…nsorboard Profiler.

PiperOrigin-RevId: 679261001
  • Loading branch information
Profiler Team authored and copybara-github committed Sep 26, 2024
1 parent 88f2da6 commit e7995e6
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions plugin/trace_viewer/tf_trace_viewer/tf-trace-viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -463,11 +463,15 @@
_replaceModel: {type: Boolean, value: true},
_hosts: {type: Array, value: []},
_selectedHosts: {type: Array, value: []},
_useNewBackend: {type: Boolean, value: false},
_useNewBackend: {type: Boolean, value: true},
// The rect being hovered (represents a trace event).
_hoverRect: {type: Object, value: null},
},

useNewBackend: function() {
return this._useNewBackend && !this._isOss;
},

ready: function() {
// Initiate the trace viewer app.
this._traceContainer = document.createElement('track-view-container');
Expand Down Expand Up @@ -1022,14 +1026,14 @@
backendToggleButton.classList.add('tooltip');
const tooltipSpan = document.createElement('span');
tooltipSpan.classList.add('tooltiptext');
tooltipSpan.textContent = 'The new backend enables faster trace data processing and also full trace search.';
tooltipSpan.textContent = 'The new backend enables full trace search and faster trace data processing.';
const labelDiv = document.createElement('div');
labelDiv.textContent = this._useNewBackend ? 'Switch to Old Backend' : 'Switch to New Backend';
labelDiv.textContent = this.useNewBackend() ? 'Switch to Old Backend' : 'Switch to New Backend';
backendToggleButton.appendChild(labelDiv);
backendToggleButton.appendChild(tooltipSpan);
backendToggleButton.addEventListener('click', () => {
const url = new URL(`/trace_viewer/${this._sessionId}`, window.location.href);
url.searchParams.set('new_backend', !this._useNewBackend);
url.searchParams.set('new_backend', !this.useNewBackend());
window.open(url.toString());
});
Polymer.dom(this._traceViewer.rightControls).insertBefore(backendToggleButton, detailsSelector);
Expand Down Expand Up @@ -1201,7 +1205,7 @@
this._createDetailFilter();
if (!this._isOss) {
this._createBackendToggleButton();
if (this._useNewBackend) {
if (this.useNewBackend()) {
this._updateSearchBehavior();
}
}
Expand Down

0 comments on commit e7995e6

Please sign in to comment.