From c9843481e978c6467bbeb3414a7ac11b6686663d Mon Sep 17 00:00:00 2001 From: Scott Bell Date: Thu, 17 Oct 2024 16:33:43 +0200 Subject: [PATCH 1/2] Revert "enforce size limit on computation" This reverts commit 07c5ba84241bc92622708be015218197aaef8cbf. --- .../condition/HistoricalTelemetryProvider.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/plugins/condition/HistoricalTelemetryProvider.js b/src/plugins/condition/HistoricalTelemetryProvider.js index a59baf1f6eb..8b41ae0f151 100644 --- a/src/plugins/condition/HistoricalTelemetryProvider.js +++ b/src/plugins/condition/HistoricalTelemetryProvider.js @@ -110,12 +110,11 @@ export default class HistoricalTelemetryProvider { async #loadTelemetryCollections() { await Promise.all( Object.entries(this.#telemetryObjects).map(async ([keystring, telemetryObject]) => { - // clone telemetry options without size as we need to load all data - const telemetryOptionsWithoutSize = { ...this.#telemetryOptions }; - delete telemetryOptionsWithoutSize.size; + // delete size as we need to scan the whole time bounds + delete this.#telemetryOptions.size; const telemetryCollection = this.#openmct.telemetry.requestCollection( telemetryObject, - telemetryOptionsWithoutSize + this.#telemetryOptions ); await telemetryCollection.load(); this.#telemetryCollections[keystring] = telemetryCollection; @@ -134,13 +133,7 @@ export default class HistoricalTelemetryProvider { const referenceTelemetryKeyString = Object.keys(dataFrame)[0]; const referenceTelemetryCollection = this.#telemetryCollections[referenceTelemetryKeyString]; const referenceTelemetryData = referenceTelemetryCollection.getAll(); - const maxDataPointsToCompute = this.#telemetryOptions.size || referenceTelemetryData.length; - for ( - let i = 0; - i < referenceTelemetryData.length && historicalData.length < maxDataPointsToCompute; - i++ - ) { - const datum = referenceTelemetryData[i]; + referenceTelemetryData.forEach((datum) => { const timestamp = datum[referenceTelemetryCollection.timeKey]; const historicalDatum = this.#computeHistoricalDatum( timestamp, @@ -150,7 +143,7 @@ export default class HistoricalTelemetryProvider { if (historicalDatum) { historicalData.push(historicalDatum); } - } + }); return historicalData; } From 6ca6a4cd008b13de1a6766d078e3d7f8ed0d5fac Mon Sep 17 00:00:00 2001 From: Scott Bell Date: Thu, 17 Oct 2024 16:34:42 +0200 Subject: [PATCH 2/2] revert size checking --- src/plugins/condition/HistoricalTelemetryProvider.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/condition/HistoricalTelemetryProvider.js b/src/plugins/condition/HistoricalTelemetryProvider.js index 8b41ae0f151..cc03887d575 100644 --- a/src/plugins/condition/HistoricalTelemetryProvider.js +++ b/src/plugins/condition/HistoricalTelemetryProvider.js @@ -110,11 +110,12 @@ export default class HistoricalTelemetryProvider { async #loadTelemetryCollections() { await Promise.all( Object.entries(this.#telemetryObjects).map(async ([keystring, telemetryObject]) => { - // delete size as we need to scan the whole time bounds - delete this.#telemetryOptions.size; + // clone telemetry options without size as we need to load all data + const telemetryOptionsWithoutSize = { ...this.#telemetryOptions }; + delete telemetryOptionsWithoutSize.size; const telemetryCollection = this.#openmct.telemetry.requestCollection( telemetryObject, - this.#telemetryOptions + telemetryOptionsWithoutSize ); await telemetryCollection.load(); this.#telemetryCollections[keystring] = telemetryCollection;