forked from kaltura/server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request kaltura#2154 from kaltura/Jupiter-10.3.0-top-playb…
…ackContext-report Jupiter 10.3.0 top playback context report
- Loading branch information
Showing
25 changed files
with
678 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
alpha/apps/kaltura/lib/reports/top_playback_context/top_playback_context_count_by_app.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
SELECT COUNT(DISTINCT context_id) count_all | ||
FROM | ||
dwh_hourly_events_context_app ev, dwh_dim_applications ap | ||
WHERE | ||
{CAT_ID_CLAUSE} | ||
AND ap.name = {APPLICATION_NAME} | ||
AND ap.partner_id = ev.partner_id | ||
AND ap.application_id = ev.application_id | ||
AND ev.partner_id = {PARTNER_ID} # PARTNER_ID | ||
AND date_id BETWEEN IF({TIME_SHIFT}>0,(DATE({FROM_DATE_ID}) - INTERVAL 1 DAY)*1, {FROM_DATE_ID}) | ||
AND IF({TIME_SHIFT}<=0,(DATE({TO_DATE_ID}) + INTERVAL 1 DAY)*1, {TO_DATE_ID}) | ||
AND hour_id >= IF (date_id = IF({TIME_SHIFT}>0,(DATE({FROM_DATE_ID}) - INTERVAL 1 DAY)*1, {FROM_DATE_ID}), IF({TIME_SHIFT}>0, 24 - {TIME_SHIFT}, ABS({TIME_SHIFT})), 0) | ||
AND hour_id < IF (date_id = IF({TIME_SHIFT}<=0,(DATE({TO_DATE_ID}) + INTERVAL 1 DAY)*1, {TO_DATE_ID}), IF({TIME_SHIFT}>0, 24 - {TIME_SHIFT}, ABS({TIME_SHIFT})), 24) | ||
AND ( count_time_viewed > 0 OR | ||
count_plays > 0 OR | ||
count_loads > 0 OR | ||
sum_time_viewed > 0) | ||
|
19 changes: 19 additions & 0 deletions
19
...altura/lib/reports/top_playback_context/top_playback_context_count_by_app_for_objects.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
SELECT COUNT(DISTINCT context_id) count_all | ||
FROM | ||
dwh_hourly_events_context_entry_user_app ev, dwh_dim_applications ap | ||
WHERE | ||
{OBJ_ID_CLAUSE} # ev.entry_id in | ||
AND {CAT_ID_CLAUSE} | ||
AND ap.name = {APPLICATION_NAME} | ||
AND ap.partner_id = ev.partner_id | ||
AND ap.application_id = ev.application_id | ||
AND ev.partner_id = {PARTNER_ID} # PARTNER_ID | ||
AND date_id BETWEEN IF({TIME_SHIFT}>0,(DATE({FROM_DATE_ID}) - INTERVAL 1 DAY)*1, {FROM_DATE_ID}) | ||
AND IF({TIME_SHIFT}<=0,(DATE({TO_DATE_ID}) + INTERVAL 1 DAY)*1, {TO_DATE_ID}) | ||
AND hour_id >= IF (date_id = IF({TIME_SHIFT}>0,(DATE({FROM_DATE_ID}) - INTERVAL 1 DAY)*1, {FROM_DATE_ID}), IF({TIME_SHIFT}>0, 24 - {TIME_SHIFT}, ABS({TIME_SHIFT})), 0) | ||
AND hour_id < IF (date_id = IF({TIME_SHIFT}<=0,(DATE({TO_DATE_ID}) + INTERVAL 1 DAY)*1, {TO_DATE_ID}), IF({TIME_SHIFT}>0, 24 - {TIME_SHIFT}, ABS({TIME_SHIFT})), 24) | ||
AND ( count_time_viewed > 0 OR | ||
count_plays > 0 OR | ||
count_loads > 0 OR | ||
sum_time_viewed > 0) | ||
|
15 changes: 15 additions & 0 deletions
15
...a/apps/kaltura/lib/reports/top_playback_context/top_playback_context_count_by_context.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
SELECT COUNT(DISTINCT context_id) count_all | ||
FROM | ||
dwh_hourly_events_context_app ev | ||
WHERE | ||
{CAT_ID_CLAUSE} | ||
AND partner_id = {PARTNER_ID} # PARTNER_ID | ||
AND date_id BETWEEN IF({TIME_SHIFT}>0,(DATE({FROM_DATE_ID}) - INTERVAL 1 DAY)*1, {FROM_DATE_ID}) | ||
AND IF({TIME_SHIFT}<=0,(DATE({TO_DATE_ID}) + INTERVAL 1 DAY)*1, {TO_DATE_ID}) | ||
AND hour_id >= IF (date_id = IF({TIME_SHIFT}>0,(DATE({FROM_DATE_ID}) - INTERVAL 1 DAY)*1, {FROM_DATE_ID}), IF({TIME_SHIFT}>0, 24 - {TIME_SHIFT}, ABS({TIME_SHIFT})), 0) | ||
AND hour_id < IF (date_id = IF({TIME_SHIFT}<=0,(DATE({TO_DATE_ID}) + INTERVAL 1 DAY)*1, {TO_DATE_ID}), IF({TIME_SHIFT}>0, 24 - {TIME_SHIFT}, ABS({TIME_SHIFT})), 24) | ||
AND ( count_time_viewed > 0 OR | ||
count_plays > 0 OR | ||
count_loads > 0 OR | ||
sum_time_viewed > 0) | ||
|
16 changes: 16 additions & 0 deletions
16
...ra/lib/reports/top_playback_context/top_playback_context_count_by_context_for_objects.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
SELECT COUNT(DISTINCT context_id) count_all | ||
FROM | ||
dwh_hourly_events_context_entry_user_app ev | ||
WHERE | ||
{OBJ_ID_CLAUSE} # ev.entry_id in | ||
AND {CAT_ID_CLAUSE} | ||
AND partner_id = {PARTNER_ID} # PARTNER_ID | ||
AND date_id BETWEEN IF({TIME_SHIFT}>0,(DATE({FROM_DATE_ID}) - INTERVAL 1 DAY)*1, {FROM_DATE_ID}) | ||
AND IF({TIME_SHIFT}<=0,(DATE({TO_DATE_ID}) + INTERVAL 1 DAY)*1, {TO_DATE_ID}) | ||
AND hour_id >= IF (date_id = IF({TIME_SHIFT}>0,(DATE({FROM_DATE_ID}) - INTERVAL 1 DAY)*1, {FROM_DATE_ID}), IF({TIME_SHIFT}>0, 24 - {TIME_SHIFT}, ABS({TIME_SHIFT})), 0) | ||
AND hour_id < IF (date_id = IF({TIME_SHIFT}<=0,(DATE({TO_DATE_ID}) + INTERVAL 1 DAY)*1, {TO_DATE_ID}), IF({TIME_SHIFT}>0, 24 - {TIME_SHIFT}, ABS({TIME_SHIFT})), 24) | ||
AND ( count_time_viewed > 0 OR | ||
count_plays > 0 OR | ||
count_loads > 0 OR | ||
sum_time_viewed > 0) | ||
|
18 changes: 18 additions & 0 deletions
18
alpha/apps/kaltura/lib/reports/top_playback_context/top_playback_context_count_by_user.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
SELECT COUNT(DISTINCT context_id) count_all | ||
FROM | ||
dwh_hourly_events_context_entry_user_app ev, dwh_dim_pusers us | ||
WHERE | ||
{OBJ_ID_CLAUSE} | ||
AND {CAT_ID_CLAUSE} | ||
AND ev.partner_id = {PARTNER_ID} # PARTNER_ID | ||
AND ev.partner_id = us.partner_id | ||
AND us.name IN {PUSER_ID} | ||
AND us.puser_id = ev.user_id | ||
AND date_id BETWEEN IF({TIME_SHIFT}>0,(DATE({FROM_DATE_ID}) - INTERVAL 1 DAY)*1, {FROM_DATE_ID}) | ||
AND IF({TIME_SHIFT}<=0,(DATE({TO_DATE_ID}) + INTERVAL 1 DAY)*1, {TO_DATE_ID}) | ||
AND hour_id >= IF (date_id = IF({TIME_SHIFT}>0,(DATE({FROM_DATE_ID}) - INTERVAL 1 DAY)*1, {FROM_DATE_ID}), IF({TIME_SHIFT}>0, 24 - {TIME_SHIFT}, ABS({TIME_SHIFT})), 0) | ||
AND hour_id < IF (date_id = IF({TIME_SHIFT}<=0,(DATE({TO_DATE_ID}) + INTERVAL 1 DAY)*1, {TO_DATE_ID}), IF({TIME_SHIFT}>0, 24 - {TIME_SHIFT}, ABS({TIME_SHIFT})), 24) | ||
AND ( count_time_viewed > 0 OR | ||
count_plays > 0 OR | ||
count_loads > 0 OR | ||
sum_time_viewed > 0) |
21 changes: 21 additions & 0 deletions
21
...ps/kaltura/lib/reports/top_playback_context/top_playback_context_count_by_user_by_app.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
SELECT COUNT(DISTINCT context_id) count_all | ||
FROM | ||
dwh_hourly_events_context_entry_user_app ev, dwh_dim_pusers us, dwh_dim_applications ap | ||
WHERE | ||
{OBJ_ID_CLAUSE} # ev.entry_id in | ||
AND {CAT_ID_CLAUSE} | ||
AND ev.partner_id = {PARTNER_ID} # PARTNER_ID | ||
AND us.name IN {PUSER_ID} | ||
AND ev.partner_id = us.partner_id | ||
AND ev.user_id = us.puser_id | ||
AND ap.name = {APPLICATION_NAME} | ||
AND ap.application_id = ev.application_id | ||
AND ap.partner_id = ev.partner_id | ||
AND date_id BETWEEN IF({TIME_SHIFT}>0,(DATE({FROM_DATE_ID}) - INTERVAL 1 DAY)*1, {FROM_DATE_ID}) | ||
AND IF({TIME_SHIFT}<=0,(DATE({TO_DATE_ID}) + INTERVAL 1 DAY)*1, {TO_DATE_ID}) | ||
AND hour_id >= IF (date_id = IF({TIME_SHIFT}>0,(DATE({FROM_DATE_ID}) - INTERVAL 1 DAY)*1, {FROM_DATE_ID}), IF({TIME_SHIFT}>0, 24 - {TIME_SHIFT}, ABS({TIME_SHIFT})), 0) | ||
AND hour_id < IF (date_id = IF({TIME_SHIFT}<=0,(DATE({TO_DATE_ID}) + INTERVAL 1 DAY)*1, {TO_DATE_ID}), IF({TIME_SHIFT}>0, 24 - {TIME_SHIFT}, ABS({TIME_SHIFT})), 24) | ||
AND ( count_time_viewed > 0 OR | ||
count_plays > 0 OR | ||
count_loads > 0 OR | ||
sum_time_viewed > 0) |
15 changes: 15 additions & 0 deletions
15
alpha/apps/kaltura/lib/reports/top_playback_context/top_playback_context_count_no_text.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
SELECT | ||
COUNT(DISTINCT context_id) count_all | ||
FROM | ||
dwh_hourly_events_context_entry_user_app ev | ||
WHERE {OBJ_ID_CLAUSE} | ||
AND partner_id = {PARTNER_ID} # PARTNER_ID | ||
AND date_id BETWEEN IF({TIME_SHIFT}>0,(DATE({FROM_DATE_ID}) - INTERVAL 1 DAY)*1, {FROM_DATE_ID}) | ||
AND IF({TIME_SHIFT}<=0,(DATE({TO_DATE_ID}) + INTERVAL 1 DAY)*1, {TO_DATE_ID}) | ||
AND hour_id >= IF (date_id = IF({TIME_SHIFT}>0,(DATE({FROM_DATE_ID}) - INTERVAL 1 DAY)*1, {FROM_DATE_ID}), IF({TIME_SHIFT}>0, 24 - {TIME_SHIFT}, ABS({TIME_SHIFT})), 0) | ||
AND hour_id < IF (date_id = IF({TIME_SHIFT}<=0,(DATE({TO_DATE_ID}) + INTERVAL 1 DAY)*1, {TO_DATE_ID}), IF({TIME_SHIFT}>0, 24 - {TIME_SHIFT}, ABS({TIME_SHIFT})), 24) | ||
AND ( count_time_viewed > 0 OR | ||
count_plays > 0 OR | ||
count_loads > 0 OR | ||
sum_time_viewed > 0) | ||
|
41 changes: 41 additions & 0 deletions
41
alpha/apps/kaltura/lib/reports/top_playback_context/top_playback_context_detail_by_app.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
SELECT | ||
context_id object_id, | ||
cat.name name, | ||
count_plays, | ||
sum_time_viewed, | ||
avg_time_viewed, | ||
avg_view_drop_off, | ||
count_loads, | ||
load_play_ratio | ||
FROM | ||
( | ||
SELECT | ||
context_id, | ||
SUM(sum_time_viewed) sum_time_viewed, | ||
SUM(sum_time_viewed)/SUM(count_plays) avg_time_viewed, | ||
SUM(count_plays) count_plays, | ||
SUM(count_loads) count_loads, | ||
(SUM(IFNULL(count_plays_25,0)) + SUM(IFNULL(count_plays_50,0)) + SUM(IFNULL(count_plays_75,0)) + SUM(IFNULL(count_plays_100,0)))/4/SUM(count_plays) avg_view_drop_off, | ||
( SUM(count_plays) / SUM(count_loads) ) load_play_ratio | ||
FROM | ||
dwh_hourly_events_context_app ev, dwh_dim_applications ap | ||
WHERE | ||
{CAT_ID_CLAUSE} | ||
AND ap.name = {APPLICATION_NAME} | ||
AND ap.partner_id = ev.partner_id | ||
AND ap.application_id = ev.application_id | ||
AND ev.partner_id = {PARTNER_ID} # PARTNER_ID | ||
AND date_id BETWEEN IF({TIME_SHIFT}>0,(DATE({FROM_DATE_ID}) - INTERVAL 1 DAY)*1, {FROM_DATE_ID}) | ||
AND IF({TIME_SHIFT}<=0,(DATE({TO_DATE_ID}) + INTERVAL 1 DAY)*1, {TO_DATE_ID}) | ||
AND hour_id >= IF (date_id = IF({TIME_SHIFT}>0,(DATE({FROM_DATE_ID}) - INTERVAL 1 DAY)*1, {FROM_DATE_ID}), IF({TIME_SHIFT}>0, 24 - {TIME_SHIFT}, ABS({TIME_SHIFT})), 0) | ||
AND hour_id < IF (date_id = IF({TIME_SHIFT}<=0,(DATE({TO_DATE_ID}) + INTERVAL 1 DAY)*1, {TO_DATE_ID}), IF({TIME_SHIFT}>0, 24 - {TIME_SHIFT}, ABS({TIME_SHIFT})), 24) | ||
AND ( count_time_viewed > 0 OR | ||
count_plays > 0 OR | ||
count_loads > 0 OR | ||
sum_time_viewed > 0 ) | ||
GROUP BY context_id | ||
ORDER BY {SORT_FIELD} | ||
LIMIT {PAGINATION_FIRST},{PAGINATION_SIZE} /* pagination */ | ||
) AS ev_stats LEFT JOIN dwh_dim_category cat | ||
ON ev_stats.context_id = cat.category_id | ||
|
Oops, something went wrong.