RDK Documentation (Open Sourced RDK Components)
ProfileEventAAMP Class Reference

Class for AAMP event Profiling. More...

#include <AampProfiler.h>

Collaboration diagram for ProfileEventAAMP:
Collaboration graph

Data Structures

struct  ProfilerBucket
 Data structure corresponding to profiler bucket. More...
 
class  TuneEvent
 Class corresponding to tune time events. More...
 

Public Member Functions

 ProfileEventAAMP ()
 ProfileEventAAMP Constructor.
 
 ~ProfileEventAAMP ()
 ProfileEventAAMP Destructor.
 
 ProfileEventAAMP (const ProfileEventAAMP &)=delete
 Copy constructor disabled. More...
 
ProfileEventAAMPoperator= (const ProfileEventAAMP &)=delete
 assignment operator disabled More...
 
void SetBandwidthBitsPerSecondVideo (long bw)
 Setting video bandwidth in bps. More...
 
void SetBandwidthBitsPerSecondAudio (long bw)
 Setting audio bandwidth in bps. More...
 
void SetDrmErrorCode (int errCode)
 Setting DRM error code. More...
 
void getTuneEventsJSON (std::string &outSS, const std::string &streamType, const char *url, bool success)
 Get tune time events in JSON format. More...
 
void TuneBegin (void)
 Profiler method to perform tune begin related operations. More...
 
void TuneEnd (TuneEndMetrics &mTuneendmetrics, std::string appName, std::string playerActiveMode, int playerId, bool playerPreBuffered, unsigned int durationSeconds, bool interfaceWifi, std::string failureReason)
 Logging performance metrics after successful tune completion. Metrics starts with IP_AAMP_TUNETIME. More...
 
void GetClassicTuneTimeInfo (bool success, int tuneRetries, int firstTuneType, long long playerLoadTime, int streamType, bool isLive, unsigned int durationinSec, char *TuneTimeInfoStr)
 Method converting the AAMP style tune performance data to IP_EX_TUNETIME style data. More...
 
void ProfileBegin (ProfilerBucketType type)
 Marking the beginning of a bucket. More...
 
void ProfileError (ProfilerBucketType type, int result=-1)
 Marking error while executing a bucket. More...
 
void ProfileEnd (ProfilerBucketType type)
 Marking the end of a bucket. More...
 
void ProfilePerformed (ProfilerBucketType type)
 Method to mark the end of a bucket, for which beginning is not marked. More...
 
void SetTuneFailCode (int tuneFailCode, ProfilerBucketType failBucketType)
 Method to set Failure code and Bucket Type used for microevents. More...
 
void SetLogger (AampLogManager *logObj)
 

Private Member Functions

unsigned int effectiveBucketTime (ProfilerBucketType id1, ProfilerBucketType id2)
 Calculating effective time of two overlapping buckets. More...
 

Private Attributes

struct ProfileEventAAMP::ProfilerBucket buckets [PROFILE_BUCKET_TYPE_COUNT]
 
long long tuneStartMonotonicBase
 
long long tuneStartBaseUTCMS
 
long long xreTimeBuckets [TuneTimeMax]
 
long bandwidthBitsPerSecondVideo
 
long bandwidthBitsPerSecondAudio
 
int drmErrorCode
 
bool enabled
 
std::list< TuneEventtuneEventList
 
std::mutex tuneEventListMtx
 
ProfilerBucketType mTuneFailBucketType
 
int mTuneFailErrorCode
 
AampLogManagermLogObj
 

yes

Class for AAMP event Profiling.

Definition at line 145 of file AampProfiler.h.


Data Structure Documentation

◆ ProfileEventAAMP::ProfilerBucket

struct ProfileEventAAMP::ProfilerBucket

Data structure corresponding to profiler bucket.

Definition at line 178 of file AampProfiler.h.

Collaboration diagram for ProfileEventAAMP::ProfilerBucket:
Collaboration graph
Data Fields
unsigned int tStart

Relative start time of operation, based on tuneStartMonotonicBase

unsigned int tFinish

Relative end time of operation, based on tuneStartMonotonicBase

int errorCount

non-zero if errors/retries occured during this operation

bool complete

true if this step already accounted for, and further profiling should be ignored

bool profileStarted

Flag that indicates,whether the profiler is started or not

Constructor & Destructor Documentation

◆ ProfileEventAAMP()

ProfileEventAAMP::ProfileEventAAMP ( const ProfileEventAAMP )
delete

Copy constructor disabled.

Member Function Documentation

◆ effectiveBucketTime()

unsigned int ProfileEventAAMP::effectiveBucketTime ( ProfilerBucketType  id1,
ProfilerBucketType  id2 
)
inlineprivate

Calculating effective time of two overlapping buckets.

Parameters
[in]id1- Bucket type 1
[in]id2- Bucket type 2
Returns
void

Definition at line 222 of file AampProfiler.h.

◆ operator=()

ProfileEventAAMP& ProfileEventAAMP::operator= ( const ProfileEventAAMP )
delete

assignment operator disabled

◆ SetBandwidthBitsPerSecondVideo()

void ProfileEventAAMP::SetBandwidthBitsPerSecondVideo ( long  bw)
inline

Setting video bandwidth in bps.

Parameters
[in]bw- Bandwidth in bps
Returns
void

Definition at line 258 of file AampProfiler.h.

◆ SetBandwidthBitsPerSecondAudio()

void ProfileEventAAMP::SetBandwidthBitsPerSecondAudio ( long  bw)
inline

Setting audio bandwidth in bps.

Parameters
[in]bw- Bandwidth in bps
Returns
void

Definition at line 269 of file AampProfiler.h.

◆ SetDrmErrorCode()

void ProfileEventAAMP::SetDrmErrorCode ( int  errCode)
inline

Setting DRM error code.

Parameters
[in]errCode- Error code
Returns
void

Definition at line 280 of file AampProfiler.h.

◆ getTuneEventsJSON()

ProfileEventAAMP::getTuneEventsJSON ( std::string &  outSS,
const std::string &  streamType,
const char *  url,
bool  success 
)

Get tune time events in JSON format.

Parameters
[out]outSS- Output JSON string
[in]streamType- Stream type
[in]url- Tune URL
[in]success- Tune success/failure
Returns
void

Definition at line 48 of file AampProfiler.cpp.

◆ TuneBegin()

void ProfileEventAAMP::TuneBegin ( void  )

Profiler method to perform tune begin related operations.

Returns
void

Definition at line 94 of file AampProfiler.cpp.

◆ TuneEnd()

void ProfileEventAAMP::TuneEnd ( TuneEndMetrics mTuneEndMetrics,
std::string  appName,
std::string  playerActiveMode,
int  playerId,
bool  playerPreBuffered,
unsigned int  durationSeconds,
bool  interfaceWifi,
std::string  failureReason 
)

Logging performance metrics after successful tune completion. Metrics starts with IP_AAMP_TUNETIME.

Format of IP_AAMP_TUNETIME:

version, // version for this protocol, initially zero
build, // incremented when there are significant player changes/optimizations
tunestartUtcMs, // when tune logically started from AAMP perspective

ManifestDownloadStartTime, // offset in milliseconds from tunestart when main manifest begins download
ManifestDownloadTotalTime, // time (ms) taken for main manifest download, relative to ManifestDownloadStartTime
ManifestDownloadFailCount, // if >0 ManifestDownloadTotalTime spans multiple download attempts

PlaylistDownloadStartTime, // offset in milliseconds from tunestart when playlist subManifest begins download
PlaylistDownloadTotalTime, // time (ms) taken for playlist subManifest download, relative to PlaylistDownloadStartTime
PlaylistDownloadFailCount, // if >0 otherwise PlaylistDownloadTotalTime spans multiple download attempts

InitFragmentDownloadStartTime, // offset in milliseconds from tunestart when init fragment begins download
InitFragmentDownloadTotalTime, // time (ms) taken for fragment download, relative to InitFragmentDownloadStartTime
InitFragmentDownloadFailCount, // if >0 InitFragmentDownloadTotalTime spans multiple download attempts

Fragment1DownloadStartTime, // offset in milliseconds from tunestart when fragment begins download
Fragment1DownloadTotalTime, // time (ms) taken for fragment download, relative to Fragment1DownloadStartTime
Fragment1DownloadFailCount, // if >0 Fragment1DownloadTotalTime spans multiple download attempts
Fragment1Bandwidth, // intrinsic bitrate of downloaded fragment

drmLicenseRequestStart, // offset in milliseconds from tunestart
drmLicenseRequestTotalTime, // time (ms) for license acquisition relative to drmLicenseRequestStart
drmFailErrorCode, // nonzero if drm license acquisition failed during tuning

LAPreProcDuration, // License acquisition pre-processing duration in ms
LANetworkDuration, // License acquisition network duration in ms
LAPostProcDuration, // License acquisition post-processing duration in ms

VideoDecryptDuration, // Video fragment decrypt duration in ms
AudioDecryptDuration, // Audio fragment decrypt duration in ms

gstStart, // offset in ms from tunestart when pipeline creation/setup begins
gstFirstFrame, // offset in ms from tunestart when first frame of video is decoded/presented
contentType, //Playback Mode. Values: CDVR, VOD, LINEAR, IVOD, EAS, CAMERA, DVR, MDVR, IPDVR, PPV
streamType, //Stream Type. Values: 10-HLS/Clear, 11-HLS/Consec, 12-HLS/Access, 13-HLS/Vanilla AES, 20-DASH/Clear, 21-DASH/WV, 22-DASH/PR
firstTune //First tune after reboot/crash
Prebuffered //If the Player was in preBuffer(BG) mode)
PreBufferedTime //Player spend Time in BG
success //Tune status contentType //Content Type. Eg: LINEAR, VOD, etc streamType //Stream Type. Eg: HLS, DASH, etc firstTune //Is it a first tune after reboot/crash.

Parameters
[in]mTuneendmetrics- Tune End metrics values
[in]appName- Application Name
[in]playerActiveMode- Aamp Player mode
[in]playerId- Aamp Player id
[in]playerPreBuffered- True/false Player has pre bufferred content
[in]durationSeconds- Asset duration in seconds
[in]interfaceWifi- Active connection is Wifi or Ethernet
[in]failureReason- Aamp player failure reason
Returns
void

Definition at line 157 of file AampProfiler.cpp.

◆ GetClassicTuneTimeInfo()

void ProfileEventAAMP::GetClassicTuneTimeInfo ( bool  success,
int  tuneRetries,
int  firstTuneType,
long long  playerLoadTime,
int  streamType,
bool  isLive,
unsigned int  durationinSec,
char *  TuneTimeInfoStr 
)

Method converting the AAMP style tune performance data to IP_EX_TUNETIME style data.

Parameters
[in]success- Tune status
[in]tuneRetries- Number of tune attempts
[in]playerLoadTime- Time at which the first tune request reached the AAMP player
[in]streamType- Type of stream. eg: HLS, DASH, etc
[in]isLive- Live channel or not
[in]durationinSec- Asset duration in seconds
[out]TuneTimeInfoStr- Formatted output string
Returns
void

Definition at line 242 of file AampProfiler.cpp.

◆ ProfileBegin()

void ProfileEventAAMP::ProfileBegin ( ProfilerBucketType  type)

Marking the beginning of a bucket.

Parameters
[in]type- Bucket type
Returns
void

Definition at line 297 of file AampProfiler.cpp.

◆ ProfileError()

void ProfileEventAAMP::ProfileError ( ProfilerBucketType  type,
int  result = -1 
)

Marking error while executing a bucket.

Parameters
[in]type- Bucket type
[in]result- Error code
Returns
void

Definition at line 311 of file AampProfiler.cpp.

◆ ProfileEnd()

void ProfileEventAAMP::ProfileEnd ( ProfilerBucketType  type)

Marking the end of a bucket.

Parameters
[in]type- Bucket type
Returns
void

Definition at line 325 of file AampProfiler.cpp.

◆ ProfilePerformed()

void ProfileEventAAMP::ProfilePerformed ( ProfilerBucketType  type)

Method to mark the end of a bucket, for which beginning is not marked.

Parameters
[in]type- Bucket type
Returns
void

Definition at line 354 of file AampProfiler.cpp.

◆ SetTuneFailCode()

ProfileEventAAMP::SetTuneFailCode ( int  tuneFailCode,
ProfilerBucketType  failBucketType 
)

Method to set Failure code and Bucket Type used for microevents.

Parameters
[in]tuneFailCode- tune Fail Code
[in]failBucketType- Profiler Bucket type
Returns
void

Definition at line 363 of file AampProfiler.cpp.

Field Documentation

◆ tuneStartMonotonicBase

long long ProfileEventAAMP::tuneStartMonotonicBase
private

Base time from Monotonic clock for interval calculation

Definition at line 200 of file AampProfiler.h.

◆ tuneStartBaseUTCMS

long long ProfileEventAAMP::tuneStartBaseUTCMS
private

common UTC base for start of tune

Definition at line 202 of file AampProfiler.h.

◆ xreTimeBuckets

long long ProfileEventAAMP::xreTimeBuckets[TuneTimeMax]
private

Start time of each buckets for classic metrics conversion

Definition at line 203 of file AampProfiler.h.

◆ bandwidthBitsPerSecondVideo

long ProfileEventAAMP::bandwidthBitsPerSecondVideo
private

Video bandwidth in bps

Definition at line 204 of file AampProfiler.h.

◆ bandwidthBitsPerSecondAudio

long ProfileEventAAMP::bandwidthBitsPerSecondAudio
private

Audio bandwidth in bps

Definition at line 205 of file AampProfiler.h.

◆ drmErrorCode

int ProfileEventAAMP::drmErrorCode
private

DRM error code

Definition at line 206 of file AampProfiler.h.

◆ enabled

bool ProfileEventAAMP::enabled
private

Profiler started or not

Definition at line 207 of file AampProfiler.h.

◆ tuneEventList

std::list<TuneEvent> ProfileEventAAMP::tuneEventList
private

List of events happened during tuning

Definition at line 208 of file AampProfiler.h.

◆ tuneEventListMtx

std::mutex ProfileEventAAMP::tuneEventListMtx
private

Mutex protecting tuneEventList

Definition at line 209 of file AampProfiler.h.

◆ mTuneFailBucketType

ProfilerBucketType ProfileEventAAMP::mTuneFailBucketType
private

ProfilerBucketType in case of error

Definition at line 211 of file AampProfiler.h.

◆ mTuneFailErrorCode

int ProfileEventAAMP::mTuneFailErrorCode
private

tune Fail Error Code

Definition at line 212 of file AampProfiler.h.


The documentation for this class was generated from the following files: