Skip to content

NR-480384: Added QOE Aggregate#75

Closed
swatijha23 wants to merge 9 commits intomasterfrom
NR-480384-QoE-AGGREGATOR
Closed

NR-480384: Added QOE Aggregate#75
swatijha23 wants to merge 9 commits intomasterfrom
NR-480384-QoE-AGGREGATOR

Conversation

@swatijha23
Copy link
Collaborator

@swatijha23 swatijha23 commented Dec 24, 2025

KPIs are calculated based on this doc - https://newrelic.atlassian.net/wiki/spaces/VERTSOL/pages/4702274467/KPIs+Transformation+QOE+Score

kpi.startupTime
kpi.startupTime = timeSinceRequested
Source: TimeSince mechanism tracking time from CONTENT_REQUEST to current moment

kpi.peakBitrate
Formula: Maximum value tracking
kpi.peakBitrate = MAX(bitrate_1, bitrate_2, ..., bitrate_n)

kpi.hadStartupFailure

Formula: Boolean logic based on playback state
kpi.hadStartupFailure = (timeSinceStarted == null)

Logic:

true = Error occurred before CONTENT_START (no timeSinceStarted attribute exists)
false = Playback started successfully
kpi.hadPlaybackFailure
Formula: Boolean flag set on error during playback
kpi.hadPlaybackFailure = qoeHadPlaybackFailure

Tracking Logic:
// On CONTENT_ERROR:

kpi.totalRebufferingTime
Formula: Cumulative sum of rebuffering durations
kpi.totalRebufferingTime = Σ(rebuffer_duration_i) where buffer_type ≠ "initial"

Tracking Logic:
// On each CONTENT_BUFFER_END:

kpi.rebufferingRatio
Formula: Percentage of time spent rebuffering
double rebufferingRatio = ((double) qoeTotalRebufferingTime / totalPlaytime) * 100;

  1. kpi.totalPlaytime
    Formula: Direct attribute mapping
    kpi.totalPlaytime = totalPlaytime

Source: Accumulated through updatePlaytime() mechanism

kpi.averageBitrate (NEW: Time-Weighted)
Formula: Time-weighted average of bitrates
// Primary calculation (time-weighted):
if (qoeTotalActiveTime > 0) {
kpi.averageBitrate = qoeTotalBitrateWeightedTime / qoeTotalActiveTime
}

// Fallback calculation (simple average):
else if (qoeBitrateCount > 0) {
kpi.averageBitrate = qoeBitrateSum / qoeBitrateCount
}

Time-Weighted Tracking:
// On each rendition change:
segmentDuration = currentTime - qoeLastRenditionChangeTime
qoeTotalBitrateWeightedTime += (previousBitrate × segmentDuration)
qoeTotalActiveTime += segmentDuration

// During calculation, include current segment:
currentSegmentDuration = currentTime - qoeLastRenditionChangeTime
totalWeightedTime = qoeTotalBitrateWeightedTime + (currentBitrate × currentSegmentDuration)
totalTime = qoeTotalActiveTime + currentSegmentDuration

averageBitrate = totalWeightedTime / totalTime

Mathematical Representation:
Average = Σ(bitrate_i × duration_i) / Σ(duration_i)

Where:

bitrate_i = bitrate during segment i
duration_i = time duration of segment i
i = 1 to n rendition changes

#58

https://docs.google.com/spreadsheets/d/1nW-WDhA-cCbCKpb_EowY99d7VKGAduy9KyxlYW1elvY/edit?gid=1943942889#gid=1943942889

Copy link
Collaborator

Choose a reason for hiding this comment

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

for clarification: Is this isContentBitrateEvent filtering required for checking which events has the bitrate information based on event?
I feel the events DOWNLOAD, CONTENT_SEEK_END also contain bitrate information. So instead of this, can we rely on checking the currentBitrate attribute exists or not for filtering if it works?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@ametku
Copy link
Contributor

ametku commented Jan 12, 2026

nova review

Copy link
Collaborator

Choose a reason for hiding this comment

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

why can't we use timeSinceStarted?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

Copy link
Collaborator

Choose a reason for hiding this comment

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

Why are we not using timeSinceStarted ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we please check from which version this Math.addExact supports?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

replaced it with a custom method

@swatijha23
Copy link
Collaborator Author

Not Required need to push to stable-beta

@swatijha23 swatijha23 mentioned this pull request Jan 29, 2026
@swatijha23 swatijha23 closed this Jan 29, 2026
@swatijha23
Copy link
Collaborator Author

not required

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

Comments