-
Notifications
You must be signed in to change notification settings - Fork 184
Kava Immersive agents - new reports #13862
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
base: Venus-22.16.0
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| <?php | ||
|
|
||
| class kKavaImmersiveAgentsReports extends kKavaReportsMgr | ||
| { | ||
| protected static $reports_def = array( | ||
|
|
||
| ReportType::IMMERSIVE_AGENTS_HIGHLIGHTS => array( | ||
| self::REPORT_METRICS => array(self::METRIC_UNIQUE_THREADS, self::EVENT_TYPE_MESSAGE_RESPONSE, self::METRIC_AVG_MESSAGES, self::METRIC_UNIQUE_USERS), | ||
| self::REPORT_GRAPH_METRICS => array(self::METRIC_UNIQUE_THREADS, self::EVENT_TYPE_MESSAGE_RESPONSE, self::METRIC_AVG_MESSAGES, self::METRIC_UNIQUE_USERS), | ||
| ), | ||
|
|
||
| ReportType::IMMERSIVE_AGENTS_MESSAGES_OVERTIME => array( | ||
| self::REPORT_GRAPH_METRICS => array(self::EVENT_TYPE_MESSAGE_RESPONSE) | ||
| ), | ||
|
|
||
| ReportType::IMMERSIVE_AGENTS_MESSAGE_FEEDBACK => array( | ||
| self::REPORT_DIMENSION_MAP => array( | ||
| 'reactionType' => self::DIMENSION_EVENT_VAR2, | ||
| ), | ||
| self::REPORT_METRICS => array(self::EVENT_TYPE_MESSAGE_FEEDBACK) | ||
| ), | ||
|
|
||
| ReportType::IMMERSIVE_AGENTS_TOP_SOURCES => array( | ||
| self::REPORT_DIMENSION_MAP => array( | ||
| 'source' => self::DIMENSION_EVENT_MULTI_VAR1, | ||
| 'source_name' => self::DIMENSION_EVENT_MULTI_VAR1, | ||
| 'source_type' => self::DIMENSION_EVENT_MULTI_VAR1, | ||
| ), | ||
| self::REPORT_ENRICH_DEF => array( | ||
| self::REPORT_ENRICH_OUTPUT => array('source_name','source_type'), | ||
| self::REPORT_ENRICH_FUNC => 'kKavaReportsMgr::genericQueryEnrich', | ||
| self::REPORT_ENRICH_CONTEXT => array( | ||
| 'peer' => 'entryPeer', | ||
| 'columns' => array('NAME', 'MEDIA_TYPE'), | ||
| ), | ||
| ), | ||
| self::REPORT_METRICS => array(self::EVENT_TYPE_MESSAGE_RESPONSE, self::METRIC_UNIQUE_USERS) | ||
| ), | ||
|
|
||
| ReportType::IMMERSIVE_AGENTS_AVATAR_SESSIONS => array( | ||
| self::REPORT_METRICS => array(self::EVENT_TYPE_AVATAR_CALL_STARTED, self::METRIC_AVATAR_CALL_DURATION, self::METRIC_AVATAR_AVG_CALL_DURATION), | ||
| ) | ||
|
|
||
| ); | ||
|
|
||
| public static function getReportDef($report_type, $input_filter, $response_options = null) | ||
| { | ||
| $report_def = isset(self::$reports_def[$report_type]) ? self::$reports_def[$report_type] : null; | ||
| if (is_null($report_def)) | ||
| { | ||
| return null; | ||
| } | ||
|
|
||
| $report_def[self::REPORT_DATA_SOURCE] = self::DATASOURCE_IMMERSIVE_AGENTS_EVENTS; | ||
| self::initTransformTimeDimensions(); | ||
|
|
||
| return $report_def; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,8 @@ | |
| const METRIC_SEGMENT_DOWNLOAD_TIME_SUM = 'segmentDownloadTimeSum'; | ||
| const METRIC_MANIFEST_DOWNLOAD_TIME_SUM = 'manifestDownloadTimeSum'; | ||
| const METRIC_VIEW_TIME_SUM = 'viewTimeSum'; | ||
| const METRIC_UNIQUE_THREAD_IDS = 'uniqueThreadIds'; | ||
| const METRIC_CALL_DURATION_SUM = 'callDurationSum'; | ||
|
|
||
| // druid calculated metrics | ||
| const METRIC_QUARTILE_PLAY_TIME = 'sum_time_viewed'; | ||
|
|
@@ -149,7 +151,11 @@ | |
| const METRIC_MEETING_CAMERA_ON_VIEW_TIME = 'meeting_camera_on_view_time'; | ||
| const METRIC_TRANSCODING_ADDED_ENTRIES_DURATION_SEC = 'transcoding_added_entries_duration_sec'; | ||
| const METRIC_TRANSCODING_ADDED_ENTRIES_DURATION = 'transcoding_added_entries_duration'; | ||
|
|
||
| const METRIC_UNIQUE_THREADS = 'unique_threads'; | ||
| const METRIC_AVG_MESSAGES = 'avg_messages'; | ||
| const METRIC_AVATAR_CALL_MESSAGES = 'avatar_call_messages'; | ||
| const METRIC_AVATAR_CALL_DURATION = 'avatar_call_duration'; | ||
| const METRIC_AVATAR_AVG_CALL_DURATION = 'avatar_avg_call_duration'; | ||
|
|
||
| // druid intermediate metrics | ||
| const METRIC_PLAYTHROUGH = 'play_through'; | ||
|
|
@@ -170,6 +176,7 @@ | |
| const METRIC_MEETING_VIEW_TIME_SEC = 'meeting_view_time_sec'; | ||
| const METRIC_UNION_LIVE_MEETING_VIEW_TIME = 'union_live_meeting_view_time'; | ||
| const METRIC_UNION_LIVE_MEETING_VOD_VIEW_TIME = 'union_live_meeting_vod_view_time'; | ||
| const METRIC_AVATAR_CALL_DURATION_SEC = 'avatar_call_duration_sec'; | ||
|
|
||
| // non druid metrics | ||
| const METRIC_BANDWIDTH_STORAGE_MB = 'combined_bandwidth_storage'; | ||
|
|
@@ -276,6 +283,7 @@ | |
| const KAVA_VE_REGISTRATION_CLASS = 'kKavaVeRegistrationReports'; | ||
| const KAVA_EP_REPORTS_CLASS = 'kKavaEventPlatformReports'; | ||
| const KAVA_CNC_REPORTS_CLASS = 'kKavaCnCReports'; | ||
| const KAVA_IMMERSIVE_AGENTS_CLASS = 'kKavaImmersiveAgentsReports'; | ||
|
|
||
| /// report settings | ||
| // report settings - common | ||
|
|
@@ -496,6 +504,10 @@ | |
| self::EVENT_TYPE_BUTTON_CLICKED, | ||
| self::EVENT_TYPE_QR_CODE_SCANNED, | ||
| self::EVENT_TYPE_DOCUMENT_IMPRESSION, | ||
| self::EVENT_TYPE_MESSAGE_RESPONSE, | ||
| self::EVENT_TYPE_AVATAR_CALL_STARTED, | ||
| self::EVENT_TYPE_AVATAR_CALL_ENDED, | ||
| self::EVENT_TYPE_MESSAGE_FEEDBACK, | ||
| ); | ||
|
|
||
| protected static $media_type_count_aggrs = array( | ||
|
|
@@ -619,6 +631,7 @@ | |
| self::METRIC_UNIQUE_PRIVATE_MESSAGE_SENT_USERS => 'floor', | ||
| self::METRIC_UNIQUE_ATTENDEES => 'floor', | ||
| self::METRIC_VE_ATTENDED_UNIQUE_USERS => 'floor', | ||
| self::METRIC_UNIQUE_THREADS => 'floor', | ||
| ); | ||
|
|
||
| protected static $transform_time_dimensions = null; | ||
|
|
@@ -695,11 +708,14 @@ | |
| self::METRIC_PRIVATE_CHAT_PARTICIPATION => true, | ||
| self::METRIC_UNIQUE_ATTENDEES => true, | ||
| self::METRIC_VE_ATTENDED_UNIQUE_USERS => true, | ||
| self::METRIC_UNIQUE_THREADS => true, | ||
| self::METRIC_AVATAR_AVG_CALL_DURATION => true, | ||
| ); | ||
|
|
||
| protected static $multi_value_dimensions = array( | ||
| self::DIMENSION_CATEGORIES, | ||
| self::DIMENSION_POSITION, | ||
| self::DIMENSION_EVENT_MULTI_VAR1, | ||
| ); | ||
|
|
||
| protected static $dynamic_metrics = array( | ||
|
|
@@ -820,6 +836,7 @@ | |
| 5 => self::KAVA_VE_REGISTRATION_CLASS, | ||
| 6 => self::KAVA_EP_REPORTS_CLASS, | ||
| 7 => self::KAVA_CNC_REPORTS_CLASS, | ||
| 8 => self::KAVA_IMMERSIVE_AGENTS_CLASS, | ||
| ); | ||
|
|
||
| protected static $aggregations_def = array(); | ||
|
|
@@ -1530,10 +1547,17 @@ | |
| self::getNotFilter(self::getInFilter(self::DIMENSION_SOURCE_TYPE, array('Recorded Live Stream'))))), | ||
| self::getLongSumAggregator(self::METRIC_TRANSCODING_ADDED_ENTRIES_DURATION_SEC, self::METRIC_DURATION_SEC)); | ||
|
|
||
| self::$metrics_def[self::METRIC_TRANSCODING_ADDED_ENTRIES_DURATION] = array( | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why this was needed to be moved?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I moved it to the list of metrics, it was in the aggregations definitions list. |
||
| self::DRUID_AGGR => array(self::METRIC_TRANSCODING_ADDED_ENTRIES_DURATION_SEC), | ||
| self::DRUID_POST_AGGR => self::getConstantRatioPostAggr( | ||
| self::METRIC_TRANSCODING_ADDED_ENTRIES_DURATION, self::METRIC_TRANSCODING_ADDED_ENTRIES_DURATION_SEC, '60')); | ||
| self::$aggregations_def[self::METRIC_UNIQUE_THREADS] = self::getFilteredAggregator( | ||
| self::getInFilter(self::DIMENSION_EVENT_TYPE, self::$immersive_agents_events_types), | ||
| self::getHyperUniqueAggregator(self::METRIC_UNIQUE_THREADS, self::METRIC_UNIQUE_THREAD_IDS)); | ||
|
|
||
| self::$aggregations_def[self::METRIC_AVATAR_CALL_MESSAGES] = self::getFilteredAggregator( | ||
| self::getSelectorFilter(self::DIMENSION_EVENT_VAR2, self::CALL_EXPERIENCE), | ||
| self::getLongSumAggregator(self::EVENT_TYPE_MESSAGE_RESPONSE, self::METRIC_COUNT)); | ||
|
|
||
| self::$aggregations_def[self::METRIC_AVATAR_CALL_DURATION_SEC] = self::getFilteredAggregator( | ||
| self::getSelectorFilter(self::DIMENSION_EVENT_TYPE, self::EVENT_TYPE_AVATAR_CALL_ENDED), | ||
| self::getLongSumAggregator(self::METRIC_AVATAR_CALL_DURATION_SEC, self::METRIC_CALL_DURATION_SUM)); | ||
|
|
||
| // Note: metrics that have post aggregations are defined below, any metric that | ||
| // is not explicitly set on $metrics_def is assumed to be a simple aggregation | ||
|
|
@@ -2047,6 +2071,30 @@ | |
| self::getHyperUniqueCardinalityPostAggregator(self::METRIC_UNIQUE_PRIVATE_MESSAGE_SENT_USERS, self::METRIC_UNIQUE_PRIVATE_MESSAGE_SENT_USERS), | ||
| self::getHyperUniqueCardinalityPostAggregator(self::METRIC_UNIQUE_LOGGED_IN_USERS, self::METRIC_UNIQUE_LOGGED_IN_USERS)))); | ||
|
|
||
| self::$metrics_def[self::METRIC_TRANSCODING_ADDED_ENTRIES_DURATION] = array( | ||
| self::DRUID_AGGR => array(self::METRIC_TRANSCODING_ADDED_ENTRIES_DURATION_SEC), | ||
| self::DRUID_POST_AGGR => self::getConstantRatioPostAggr( | ||
| self::METRIC_TRANSCODING_ADDED_ENTRIES_DURATION, self::METRIC_TRANSCODING_ADDED_ENTRIES_DURATION_SEC, '60')); | ||
|
|
||
| self::$metrics_def[self::METRIC_AVG_MESSAGES] = array( | ||
| self::DRUID_AGGR => array(self::EVENT_TYPE_MESSAGE_RESPONSE, self::METRIC_UNIQUE_THREADS), | ||
| self::DRUID_POST_AGGR => self::getArithmeticPostAggregator( | ||
| self::METRIC_AVG_MESSAGES, "/", array( | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can there be 0 division?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Druid does not throw an error in such case |
||
| self::getFieldAccessPostAggregator(self::EVENT_TYPE_MESSAGE_RESPONSE), | ||
| self::getHyperUniqueCardinalityPostAggregator(self::METRIC_UNIQUE_THREADS, self::METRIC_UNIQUE_THREADS)))); | ||
|
|
||
| self::$metrics_def[self::METRIC_AVATAR_CALL_DURATION] = array( | ||
| self::DRUID_AGGR => array(self::METRIC_AVATAR_CALL_DURATION_SEC), | ||
| self::DRUID_POST_AGGR => self::getConstantRatioPostAggr( | ||
| self::METRIC_AVATAR_CALL_DURATION, self::METRIC_AVATAR_CALL_DURATION_SEC, '60')); | ||
|
|
||
| self::$metrics_def[self::METRIC_AVATAR_AVG_CALL_DURATION] = array( | ||
| self::DRUID_AGGR => array(self::METRIC_AVATAR_CALL_DURATION_SEC, self::EVENT_TYPE_AVATAR_CALL_ENDED), | ||
| self::DRUID_POST_AGGR => self::getArithmeticPostAggregator( | ||
| self::METRIC_AVATAR_AVG_CALL_DURATION, '/', array( | ||
| self::getConstantRatioPostAggr('subCallDuration', self::METRIC_AVATAR_CALL_DURATION_SEC, '60'), | ||
| self::getFieldAccessPostAggregator(self::EVENT_TYPE_AVATAR_CALL_ENDED)))); | ||
|
|
||
| self::$headers_to_metrics = array_flip(self::$metrics_to_headers); | ||
|
|
||
| self::$combined_metrics = array( | ||
|
|
@@ -3006,6 +3054,8 @@ | |
| 'companies' => array(self::DRUID_DIMENSION => self::DIMENSION_COMPANY), | ||
| 'event_session_context_ids' => array(self::DRUID_DIMENSION => self::DIMENSION_EVENT_SESSION_CONTEXT_ID), | ||
| 'video_codec' => array(self::DRUID_DIMENSION => self::DIMENSION_VIDEO_CODEC), | ||
| 'agent_ids' => array(self::DRUID_DIMENSION => self::DIMENSION_AGENT_ID), | ||
| 'genie_ids' => array(self::DRUID_DIMENSION => self::DIMENSION_GENIE_ID), | ||
| ); | ||
|
|
||
| foreach ($field_dim_map as $field => $field_filter_def) | ||
|
|
@@ -3453,10 +3503,17 @@ | |
| { | ||
| $report_def = self::getBaseReportDef($data_source, $partner_id, $intervals, array(), $filter, self::DRUID_GRANULARITY_ALL, $filter_metrics); | ||
| $report_def[self::DRUID_QUERY_TYPE] = self::DRUID_TIMESERIES; | ||
| $report_def[self::DRUID_AGGR][] = array( | ||
| $cardinality_aggr = array( | ||
| self::DRUID_TYPE => self::DRUID_CARDINALITY, | ||
| self::DRUID_NAME => self::METRIC_CARDINALITY, | ||
| self::DRUID_FIELDS => is_array($dimension) ? $dimension : array($dimension)); | ||
| self::DRUID_FIELDS => is_array($dimension) ? $dimension : array($dimension) | ||
| ); | ||
| if (in_array($dimension, self::$multi_value_dimensions)) | ||
| { | ||
| $cardinality_aggr[self::DRUID_BY_ROW] = false; | ||
| } | ||
| $report_def[self::DRUID_AGGR][] = $cardinality_aggr; | ||
|
|
||
| return $report_def; | ||
| } | ||
|
|
||
|
|
@@ -5767,7 +5824,7 @@ | |
|
|
||
| protected static function getTotalTableCount($partner_id, $report_def, reportsInputFilter $input_filter, $intervals, $druid_filter, $dimension, $object_ids, $response_options) | ||
| { | ||
| $cache_key = 'reportCount-' . md5("$partner_id|".serialize($report_def)."|$object_ids|".serialize($input_filter)); | ||
|
Check warning on line 5827 in alpha/apps/kaltura/lib/reports/kKavaReportsMgr.class.php
|
||
|
|
||
| $cache = kCacheManager::getSingleLayerCache(kCacheManager::CACHE_TYPE_REPORTS_COUNT); | ||
| if ($cache) | ||
|
|
||
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 think there is already a use case where we need to return number of calls (maybe per agents)
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 the avatar call started event, no need to define another metric for this.