-
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
Table performance paging #7399
Table performance paging #7399
Changes from all commits
ba476d6
c408530
fbe1a68
c5761c1
6c53b77
46f897f
cdc3f6b
fdd3cb4
395a735
46d72ad
08c3b14
d9629db
6fbdf7f
10b559d
2639ab2
7693c70
00fa2d5
2efadaf
6fc0022
088f948
e185270
a922578
adc8ba8
c623d01
fdd390d
ff0d393
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 |
---|---|---|
|
@@ -37,10 +37,11 @@ export default class TelemetryTable extends EventEmitter { | |
|
||
this.domainObject = domainObject; | ||
this.openmct = openmct; | ||
this.rowCount = 100; | ||
this.tableComposition = undefined; | ||
this.datumCache = []; | ||
this.configuration = new TelemetryTableConfiguration(domainObject, openmct); | ||
this.telemetryMode = this.configuration.getTelemetryMode(); | ||
this.rowLimit = this.configuration.getRowLimit(); | ||
this.paused = false; | ||
this.keyString = this.openmct.objects.makeKeyString(this.domainObject.identifier); | ||
|
||
|
@@ -101,18 +102,40 @@ export default class TelemetryTable extends EventEmitter { | |
} | ||
} | ||
|
||
updateTelemetryMode(mode) { | ||
if (this.telemetryMode === mode) { | ||
return; | ||
} | ||
|
||
this.telemetryMode = mode; | ||
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. Spacing is a little weird here. Did prettier demand it? 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. yea on autosave 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. thats how i would have wrote it... hehe |
||
|
||
this.updateRowLimit(); | ||
|
||
this.clearAndResubscribe(); | ||
} | ||
|
||
updateRowLimit() { | ||
if (this.telemetryMode === 'performance') { | ||
this.tableRows.setLimit(this.rowLimit); | ||
} else { | ||
this.tableRows.removeLimit(); | ||
} | ||
} | ||
|
||
createTableRowCollections() { | ||
this.tableRows = new TableRowCollection(); | ||
|
||
//Fetch any persisted default sort | ||
let sortOptions = this.configuration.getConfiguration().sortOptions; | ||
|
||
//If no persisted sort order, default to sorting by time system, ascending. | ||
//If no persisted sort order, default to sorting by time system, descending. | ||
sortOptions = sortOptions || { | ||
key: this.openmct.time.timeSystem().key, | ||
direction: 'asc' | ||
direction: 'desc' | ||
}; | ||
|
||
this.updateRowLimit(); | ||
|
||
this.tableRows.sortBy(sortOptions); | ||
this.tableRows.on('resetRowsFromAllData', this.resetRowsFromAllData); | ||
} | ||
|
@@ -144,6 +167,11 @@ export default class TelemetryTable extends EventEmitter { | |
|
||
this.removeTelemetryCollection(keyString); | ||
|
||
if (this.telemetryMode === 'performance') { | ||
requestOptions.size = this.rowLimit; | ||
requestOptions.enforceSize = true; | ||
} | ||
|
||
this.telemetryCollections[keyString] = this.openmct.telemetry.requestCollection( | ||
telemetryObject, | ||
requestOptions | ||
|
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.
Nice, this is a simple way of enforcing size with a small change