Skip to content

Conversation

@scottbell
Copy link
Contributor

@scottbell scottbell commented Aug 20, 2024

Describe your changes:

Closes #7823

Add a new object called "Derived Telemetry" that allows telemetry to be used in simple mathematical expressions.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Is this a notable change that will require a special callout in the release notes? For example, will this break compatibility with existing APIs or projects that consume these plugins?

Author Checklist

  • Changes address original issue?
  • Tests included and/or updated with changes?
  • Has this been smoke tested?
  • Have you associated this PR with a type: label? Note: this is not necessarily the same as the original issue.
  • Have you associated a milestone with this PR? Note: leave blank if unsure.
  • Testing instructions included in associated issue OR is this a dependency/testcase change?

Reviewer Checklist

  • Changes appear to address issue?
  • Reviewer has tested changes by following the provided instructions?
  • Changes appear not to be breaking changes?
  • Appropriate automated tests included?
  • Code style and in-line documentation are appropriate?

charlesh88 and others added 2 commits November 15, 2024 12:29
- Markup/CSS sanding and shimming for derived telemetry front-end.
- Toggle switch CSS improved to use `gap` instead of left margin.
@akhenry akhenry removed this from the Target:4.1.0 milestone Jan 29, 2025
@shefalijoshi shefalijoshi requested review from shefalijoshi and removed request for ozyx and unlikelyzero July 7, 2025 22:29
@shefalijoshi shefalijoshi added this to the Dependency updates milestone Jul 21, 2025
@shefalijoshi shefalijoshi added the pr:e2e:couchdb npm run test:e2e:couchdb label Jul 21, 2025
@shefalijoshi
Copy link
Contributor

If the parameter type doesn't match the expression operation, there is no error shown to the user. The operation fails silently.
For example, trying to add the Name with the Sine value here throws an error in the console, but nothing is displayed to the user.
image

this._setTimeSystem(this.options.timeContext.getTimeSystem());
this.lastBounds = this.options.timeContext.getBounds();
// prioritize passed options over time bounds
if (this.options.start) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we're standardizing request options in this._requestHistoricalTelemetry();, recommend moving the assignment of this.lastBounds into that function after options are standardized.

Copy link
Contributor

Choose a reason for hiding this comment

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

@jvigliotta Need your thoughts here.

Copy link
Contributor

Choose a reason for hiding this comment

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

added a couple comments!

// if derived, we can't use the old data
let data = this.getSeriesData();

if (this.metadata.value(this.get('yKey')).derived) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand this. Why can't we show historic computed/derived telemetry?

],
yAxis: persistedSeriesConfig.yAxis
yAxis: persistedSeriesConfig.yAxis,
...this.childObject.configuration
Copy link
Contributor

Choose a reason for hiding this comment

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

This shows 2 Config tabs in the inspector - One for the derived telemetry item and one for the stacked plot Config.

:aria-label="`Reference ${parameter.name} Object Path`"
>
<ObjectPathString
:domain-object="compsManager.getTelemetryObjectForParameter(parameter.keyString)"
Copy link
Contributor

Choose a reason for hiding this comment

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

skeptical of calling the compsManager.getTelemetryObjectForParameter method here.

// Because this is triggered by a composition change, we have
// to defer mutation of our domain object, otherwise we might
// mutate an outdated version of the domain object.
setTimeout(function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider observing the composition property of the domainObject instead of the parameterAdded, parameterRemoved events to make this change.
We should not need this setTimeout.

Copy link
Contributor

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

@jvigliotta jvigliotta left a comment

Choose a reason for hiding this comment

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

Couple thoughts added inline

*/
async _requestHistoricalTelemetry() {
const options = this.openmct.telemetry.standardizeRequestOptions({ ...this.options });
this.lastBounds = {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is ok from what I can see. You've added or removed other items that seem to cover this change. We'll definitely need to thoroughly test time conductor/fixed/realtime functionality though.

* @private
*/
_processNewTelemetry(telemetryData) {
_processNewTelemetry(telemetryData, isSubscriptionData = false) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think with the below commented out code, isSubscriptionData isn't used really anymore?


this.loaded = true;

return historicalTelemetryLoadedPromise;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we'll need to update the docs for this method to show it's returning a promise now for the historical request?

this.#telemetryLoadedPromises.push(telemetryLoadedPromise);
}
});
await Promise.all(this.#telemetryLoadedPromises);
Copy link
Contributor

Choose a reason for hiding this comment

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

We may be able to use something like we do in tables here:

this.telemetryCollections[keyString].on('requestStarted', this.incrementOutstandingRequests);
this.telemetryCollections[keyString].on('requestEnded', this.decrementOutstandingRequests);

then we don't need to change the load() method of telemetry collections?

Copy link
Contributor

Choose a reason for hiding this comment

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

That's a good idea. I'll try that.

this._setTimeSystem(this.options.timeContext.getTimeSystem());
this.lastBounds = this.options.timeContext.getBounds();
// prioritize passed options over time bounds
if (this.options.start) {
Copy link
Contributor

Choose a reason for hiding this comment

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

added a couple comments!

@akhenry akhenry added the rodap label Nov 17, 2025
@akhenry akhenry requested review from akhenry and jvigliotta and removed request for akhenry and charlesh88 November 17, 2025 19:43
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Nov 17, 2025

function reload() {
clearData();
outputTelemetryCollection._requestHistoricalTelemetry();
Copy link
Contributor

Choose a reason for hiding this comment

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

Huh. Interesting...Need to check this. We shouldn't be calling internal methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

notable_change A change which should be noted in the changelog rodap type:enhancement type:feature Feature. Required intentional design

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Derived Telemetry Prototype

7 participants