-
Notifications
You must be signed in to change notification settings - Fork 15
NR-480384: Add QOE metrics #58
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
Conversation
NewRelicVideoCore/src/main/java/com/newrelic/videoagent/core/tracker/NRVideoTracker.java
Outdated
Show resolved
Hide resolved
NewRelicVideoCore/src/main/java/com/newrelic/videoagent/core/tracker/NRVideoTracker.java
Outdated
Show resolved
Hide resolved
NewRelicVideoCore/src/main/java/com/newrelic/videoagent/core/tracker/NRVideoTracker.java
Outdated
Show resolved
Hide resolved
NewRelicVideoCore/src/main/java/com/newrelic/videoagent/core/tracker/NRVideoTracker.java
Outdated
Show resolved
Hide resolved
NewRelicVideoCore/src/main/java/com/newrelic/videoagent/core/tracker/NRVideoTracker.java
Outdated
Show resolved
Hide resolved
NewRelicVideoCore/src/main/java/com/newrelic/videoagent/core/tracker/NRVideoTracker.java
Outdated
Show resolved
Hide resolved
NewRelicVideoCore/src/main/java/com/newrelic/videoagent/core/tracker/NRVideoTracker.java
Outdated
Show resolved
Hide resolved
NewRelicVideoCore/src/main/java/com/newrelic/videoagent/core/tracker/NRVideoTracker.java
Outdated
Show resolved
Hide resolved
NewRelicVideoCore/src/main/java/com/newrelic/videoagent/core/tracker/NRVideoTracker.java
Outdated
Show resolved
Hide resolved
NewRelicVideoCore/src/main/java/com/newrelic/videoagent/core/tracker/NRVideoTracker.java
Outdated
Show resolved
Hide resolved
NewRelicVideoCore/src/main/java/com/newrelic/videoagent/core/NRDef.java
Outdated
Show resolved
Hide resolved
NewRelicVideoCore/src/main/java/com/newrelic/videoagent/core/tracker/NRVideoTracker.java
Outdated
Show resolved
Hide resolved
NewRelicVideoCore/src/main/java/com/newrelic/videoagent/core/tracker/NRVideoTracker.java
Outdated
Show resolved
Hide resolved
NewRelicVideoCore/src/main/java/com/newrelic/videoagent/core/tracker/NRVideoTracker.java
Show resolved
Hide resolved
…80384-Android-QOE
ametku
left a comment
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.
I have added some comments as initial review. I need to verify more for qoe attrs.
| @@ -0,0 +1,60 @@ | |||
| name: Publish Release | |||
|
|
|||
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.
The QOE_AGGREGATE data is has a lot more attrs. The attrs in QOE_AGGREGATE should be selected. Please check browser implementation for the same
| @@ -0,0 +1,60 @@ | |||
| name: Publish Release | |||
|
|
|||
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.
@swatijha23 There is sometime wrong. these files should not be part of your PR. They are already part of master. can you fix it?
| } | ||
| } | ||
| def applicationToken = localProperties.getProperty('nr.applicationToken', "") | ||
|
|
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.
Even these files. I would suggest add your changes only part of this PR
|
|
||
| // Time-weighted bitrate calculation fields | ||
| private Long qoeCurrentBitrate; | ||
| private Long qoeLastRenditionChangeTime; |
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 actually not rendition change but bitrate change. Can you refer to browser implementation
|
|
||
| // Add captured timestamps to QOE_AGGREGATE events | ||
| if (contentRequestTimestamp != null) { | ||
| kpiAttributes.put("timeSinceRequested", contentRequestTimestamp); |
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.
why are we including timeSinceRequested for QOE ? Please check browser implementation to verify the attrs part of QOE event
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:
Formula: Boolean flag set on error during playback
kpi.hadPlaybackFailure = qoeHadPlaybackFailure
Tracking Logic:
// On CONTENT_ERROR:
Formula: Cumulative sum of rebuffering durations
kpi.totalRebufferingTime = Σ(rebuffer_duration_i) where buffer_type ≠ "initial"
Tracking Logic:
// On each CONTENT_BUFFER_END:
Formula: Percentage of time spent rebuffering
double rebufferingRatio = ((double) qoeTotalRebufferingTime / totalPlaytime) * 100;
Formula: Direct attribute mapping
kpi.totalPlaytime = totalPlaytime
Source: Accumulated through updatePlaytime() mechanism
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: