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

[Telemetry Table] Address issues found during testing Table Performance #7529

Merged
merged 17 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
applying changes made in Edit Properties
  • Loading branch information
jvigliotta authored and ozyx committed Mar 12, 2024
commit bb766aba7ce8f165b6aadc4292480cf9dd89631b
6 changes: 5 additions & 1 deletion src/plugins/telemetryTable/TelemetryTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,11 @@ export default class TelemetryTable extends EventEmitter {
this.clearAndResubscribe();
}

updateRowLimit() {
updateRowLimit(rowLimit) {
if (rowLimit) {
this.rowLimit = rowLimit;
}

if (this.telemetryMode === 'performance') {
this.tableRows.setLimit(this.rowLimit);
} else {
Expand Down
10 changes: 5 additions & 5 deletions src/plugins/telemetryTable/TelemetryTableType.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*****************************************************************************/

export default function getTelemetryTableType(options = {}) {
const { telemetryMode = 'performance', persistModeChanges = true, rowLimit = 50 } = options;
const { telemetryMode = 'performance', persistModeChange = true, rowLimit = 50 } = options;

return {
name: 'Telemetry Table',
Expand Down Expand Up @@ -51,12 +51,12 @@ export default function getTelemetryTableType(options = {}) {
name: 'Persist Data Mode Changes',
control: 'toggleSwitch',
cssClass: 'l-input',
key: 'persistModeChanges',
property: ['configuration', 'persistModeChanges']
key: 'persistModeChange',
property: ['configuration', 'persistModeChange']
},
{
name: 'Limited Data Mode Row Limit',
control: 'number',
control: 'numberfield',
cssClass: 'l-input',
key: 'rowLimit',
property: ['configuration', 'rowLimit']
Expand All @@ -68,7 +68,7 @@ export default function getTelemetryTableType(options = {}) {
columnWidths: {},
hiddenColumns: {},
telemetryMode,
persistModeChanges,
persistModeChange,
rowLimit
};
}
Expand Down
28 changes: 26 additions & 2 deletions src/plugins/telemetryTable/components/TableComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ export default {
totalNumberOfRows: 0,
rowContext: {},
telemetryMode: configuration.telemetryMode,
persistModeChanges: configuration.persistModeChanges,
persistModeChange: configuration.persistModeChange,
afterLoadActions: []
};
},
Expand Down Expand Up @@ -537,6 +537,8 @@ export default {
this.table.on('outstanding-requests', this.outstandingRequests);
this.table.on('telemetry-staleness', this.handleStaleness);

this.table.configuration.on('change', this.handleConfigurationChanges);

this.table.tableRows.on('add', this.rowsAdded);
this.table.tableRows.on('remove', this.rowsRemoved);
this.table.tableRows.on('sort', this.throttledUpdateVisibleRows);
Expand Down Expand Up @@ -566,6 +568,8 @@ export default {
this.table.off('outstanding-requests', this.outstandingRequests);
this.table.off('telemetry-staleness', this.handleStaleness);

this.table.configuration.off('change', this.handleConfigurationChanges);

this.table.tableRows.off('add', this.rowsAdded);
this.table.tableRows.off('remove', this.rowsRemoved);
this.table.tableRows.off('sort', this.throttledUpdateVisibleRows);
Expand All @@ -589,6 +593,26 @@ export default {
this.afterLoadActions = [];
}
},
handleConfigurationChanges(changes) {
const { rowLimit, telemetryMode, persistModeChange } = changes;

this.persistModeChange = persistModeChange;

if (this.rowLimit !== rowLimit) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akhenry this was previously this.rowLimit === rowLimit which was causing duplicate unsubscribes with the second unsubscribe failing because it was already removed in the realtime-provider.

this.rowLimit = rowLimit;
this.table.updateRowLimit(rowLimit);

if (this.telemetryMode === telemetryMode) {
// need to clear and resubscribe, if different, handled below
this.table.clearAndResubscribe();
}
}

if (this.telemetryMode !== telemetryMode) {
this.telemetryMode = telemetryMode;
this.table.updateTelemetryMode(telemetryMode);
}
},
updateVisibleRows() {
if (!this.updatingView) {
this.updatingView = this.renderWhenVisible(() => {
Expand Down Expand Up @@ -1187,7 +1211,7 @@ export default {
updateTelemetryMode() {
this.telemetryMode = this.telemetryMode === 'unlimited' ? 'performance' : 'unlimited';

if (this.persistModeChanges) {
if (this.persistModeChange) {
this.table.configuration.setTelemetryMode(this.telemetryMode);
}

Expand Down