-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Changes from all commits
04916f0
0509933
fe28069
bb766ab
fc36b02
337b243
a9533a5
aa2370a
28c7eff
6d5ad13
8ee9409
7e049de
1507fa5
18a6b47
5791c20
1c7ac17
2de4c21
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,10 +20,31 @@ | |
* at runtime from the About dialog for additional information. | ||
*****************************************************************************/ | ||
|
||
import { createDomainObjectWithDefaults, setTimeConductorBounds } from '../../../../appActions.js'; | ||
import { | ||
createDomainObjectWithDefaults, | ||
setTimeConductorBounds, | ||
setTimeConductorMode | ||
} from '../../../../appActions.js'; | ||
import { expect, test } from '../../../../pluginFixtures.js'; | ||
|
||
test.describe('Telemetry Table', () => { | ||
let table; | ||
test.beforeEach(async ({ page }) => { | ||
await page.goto('./', { waitUntil: 'domcontentloaded' }); | ||
table = await createDomainObjectWithDefaults(page, { type: 'Telemetry Table' }); | ||
}); | ||
|
||
test('Limits to 50 rows by default', async ({ page }) => { | ||
await createDomainObjectWithDefaults(page, { | ||
type: 'Sine Wave Generator', | ||
parent: table.uuid | ||
}); | ||
await page.goto(table.url); | ||
await setTimeConductorMode(page, false); | ||
const rows = page.getByLabel('table content').getByLabel('Table Row'); | ||
await expect(rows).toHaveCount(50); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❤️ |
||
}); | ||
|
||
test('unpauses and filters data when paused by button and user changes bounds', async ({ | ||
page | ||
}) => { | ||
|
@@ -34,7 +55,6 @@ test.describe('Telemetry Table', () => { | |
|
||
await page.goto('./', { waitUntil: 'domcontentloaded' }); | ||
|
||
const table = await createDomainObjectWithDefaults(page, { type: 'Telemetry Table' }); | ||
await createDomainObjectWithDefaults(page, { | ||
type: 'Sine Wave Generator', | ||
parent: table.uuid | ||
|
@@ -78,7 +98,6 @@ test.describe('Telemetry Table', () => { | |
test('Supports filtering telemetry by regular text search', async ({ page }) => { | ||
await page.goto('./', { waitUntil: 'domcontentloaded' }); | ||
|
||
const table = await createDomainObjectWithDefaults(page, { type: 'Telemetry Table' }); | ||
await createDomainObjectWithDefaults(page, { | ||
type: 'Event Message Generator', | ||
parent: table.uuid | ||
|
@@ -121,7 +140,6 @@ test.describe('Telemetry Table', () => { | |
test('Supports filtering using Regex', async ({ page }) => { | ||
await page.goto('./', { waitUntil: 'domcontentloaded' }); | ||
|
||
const table = await createDomainObjectWithDefaults(page, { type: 'Telemetry Table' }); | ||
await createDomainObjectWithDefaults(page, { | ||
type: 'Event Message Generator', | ||
parent: table.uuid | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -398,7 +398,8 @@ | |
totalNumberOfRows: 0, | ||
rowContext: {}, | ||
telemetryMode: configuration.telemetryMode, | ||
persistModeChanges: configuration.persistModeChanges | ||
persistModeChange: configuration.persistModeChange, | ||
afterLoadActions: [] | ||
}; | ||
}, | ||
computed: { | ||
|
@@ -458,10 +459,8 @@ | |
}, | ||
loading: { | ||
handler(isLoading) { | ||
if (isLoading) { | ||
this.setLoadingPromise(); | ||
} else { | ||
this.loadFinishResolve(); | ||
if (!isLoading) { | ||
this.runAfterLoadActions(); | ||
} | ||
|
||
if (this.viewActionsCollection) { | ||
|
@@ -538,6 +537,8 @@ | |
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); | ||
|
@@ -567,6 +568,8 @@ | |
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); | ||
|
@@ -581,11 +584,34 @@ | |
this.table.destroy(); | ||
}, | ||
methods: { | ||
setLoadingPromise() { | ||
this.loadFinishResolve = null; | ||
this.isFinishedLoading = new Promise((resolve, reject) => { | ||
this.loadFinishResolve = resolve; | ||
}); | ||
addToAfterLoadActions(func) { | ||
this.afterLoadActions.push(func); | ||
}, | ||
runAfterLoadActions() { | ||
if (this.afterLoadActions.length > 0) { | ||
this.afterLoadActions.forEach((action) => action()); | ||
this.afterLoadActions = []; | ||
} | ||
}, | ||
handleConfigurationChanges(changes) { | ||
const { rowLimit, telemetryMode, persistModeChange } = changes; | ||
|
||
this.persistModeChange = persistModeChange; | ||
|
||
if (this.rowLimit !== rowLimit) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @akhenry this was previously |
||
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) { | ||
|
@@ -1042,7 +1068,7 @@ | |
let row = allRows[i]; | ||
row.marked = true; | ||
|
||
if (row !== baseRow) { | ||
if (row !== baseRow && this.markedRows.indexOf(row) === -1) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we were getting dupes in markedRows which caused the count to be off |
||
this.markedRows.push(row); | ||
} | ||
} | ||
|
@@ -1166,11 +1192,9 @@ | |
{ | ||
label, | ||
emphasis: true, | ||
callback: async () => { | ||
callback: () => { | ||
this.addToAfterLoadActions(callback); | ||
this.updateTelemetryMode(); | ||
await this.isFinishedLoading; | ||
|
||
callback(); | ||
|
||
dialog.dismiss(); | ||
} | ||
|
@@ -1187,7 +1211,7 @@ | |
updateTelemetryMode() { | ||
this.telemetryMode = this.telemetryMode === 'unlimited' ? 'performance' : 'unlimited'; | ||
|
||
if (this.persistModeChanges) { | ||
if (this.persistModeChange) { | ||
this.table.configuration.setTelemetryMode(this.telemetryMode); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is fine, but we should we try to avoid this appaction