Skip to content
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

Firefox Essentials - New Project Checkin #772

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added firefox_essentials/.gitkeep
Empty file.
Empty file.
16 changes: 16 additions & 0 deletions firefox_essentials/explores/clients_daily_summary.explore.lkml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
include: "/firefox_essentials/views/*.view.lkml" # include all views in the views/ folder in this project

explore: clients_daily_summary {
label: "Firefox Essentials - Daily Summary"
from: clients_daily
join: clients_daily_crashes {
type: left_outer
relationship: one_to_one
sql_on: ${clients_daily_summary.client_id} = ${clients_daily_crashes.client_id} AND ${clients_daily_summary.submission_date} = ${clients_daily_crashes.submission_date};;
}
join: clients_daily_telemetry {
type: left_outer
relationship: one_to_one
sql_on: ${clients_daily_summary.client_id} = ${clients_daily_telemetry.client_id} AND ${clients_daily_summary.submission_date} = ${clients_daily_telemetry.submission_date};;
}
}
4 changes: 4 additions & 0 deletions firefox_essentials/firefox_essentials_core.model.lkml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
connection: "telemetry"

include: "/firefox_essentials/views/*.view.lkml"
include: "/firefox_essentials/explores/*.explore.lkml"
Empty file.
88 changes: 88 additions & 0 deletions firefox_essentials/views/clients_daily.view.lkml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@

view: clients_daily {
derived_table: {
sql: select
client_id
,submission_date
,first_seen_date
,days_since_first_seen
,BIT_COUNT(days_seen_bits) as dou
,country
,case when lower(os) like '%windows%' then 'Windows'
when lower(os) like '%linux%' then 'Linux'
when lower(os) like '%darwin%' then 'Mac'
else 'Other' end as normalized_os
,is_regular_user_v3 as is_regular_user
,normalized_channel
from telemetry.clients_last_seen c
where submission_date >= date_add(date_trunc(current_date, year), interval -2 year)
and sample_id <= 4
and days_since_seen = 0 ;;
}

measure: count {
type: count
drill_fields: [detail*]
}

dimension: client_id {
type: string
sql: ${TABLE}.client_id ;;
}

dimension: submission_date {
type: date
datatype: date
sql: ${TABLE}.submission_date ;;
}

dimension: first_seen_date {
type: date
datatype: date
sql: ${TABLE}.first_seen_date ;;
}

dimension: days_since_first_seen {
type: number
sql: ${TABLE}.days_since_first_seen ;;
}

dimension: dou {
type: number
sql: ${TABLE}.dou ;;
}

dimension: country {
type: string
sql: ${TABLE}.country ;;
}

dimension: normalized_os {
type: string
sql: ${TABLE}.normalized_os ;;
}

dimension: is_regular_user {
type: yesno
sql: ${TABLE}.is_regular_user ;;
}

dimension: normalized_channel {
type: string
sql: ${TABLE}.normalized_channel ;;
}

set: detail {
fields: [
client_id,
submission_date,
first_seen_date,
days_since_first_seen,
dou,
country,
normalized_os,
is_regular_user,
normalized_channel
]
}
}
97 changes: 97 additions & 0 deletions firefox_essentials/views/clients_daily_crashes.view.lkml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@

view: clients_daily_crashes {
derived_table: {
sql: select
cd.client_id
,cd.submission_date
,sum(cd.content_crash_count) as content_crash_count
,sum(cd.gpu_crash_count) as gpu_crash_count
,sum(cd.main_crash_count) as main_crash_count
,sum(cd.rdd_crash_count) as rdd_crash_count
,sum(cd.socket_crash_count) as socket_crash_count
,sum(cd.utility_crash_count) as utility_crash_count
,sum(cd.vr_crash_count) as vr_crash_count
,sum(ifnull(cd.content_crash_count,0)
+ifnull(cd.gpu_crash_count,0)
+ifnull(cd.main_crash_count,0)
+ifnull(cd.rdd_crash_count,0)
+ifnull(cd.socket_crash_count,0)
+ifnull(cd.utility_crash_count,0)
+ifnull(cd.vr_crash_count,0)) as total_crashes
from telemetry.crashes_daily cd
where cd.submission_date >= date_add(date_trunc(current_date, year), interval -2 year)
and cd.sample_id <= 4
group by 1,2;;
}

measure: count {
type: count
drill_fields: [detail*]
}

dimension: client_id {
type: string
sql: ${TABLE}.client_id ;;
}

dimension: submission_date {
type: date
datatype: date
sql: ${TABLE}.submission_date ;;
}

dimension: content_crash_count {
type: number
sql: ${TABLE}.content_crash_count ;;
}

dimension: gpu_crash_count {
type: number
sql: ${TABLE}.gpu_crash_count ;;
}

dimension: main_crash_count {
type: number
sql: ${TABLE}.main_crash_count ;;
}

dimension: rdd_crash_count {
type: number
sql: ${TABLE}.rdd_crash_count ;;
}

dimension: socket_crash_count {
type: number
sql: ${TABLE}.socket_crash_count ;;
}

dimension: utility_crash_count {
type: number
sql: ${TABLE}.utility_crash_count ;;
}

dimension: vr_crash_count {
type: number
sql: ${TABLE}.vr_crash_count ;;
}

dimension: total_crashes {
type: number
sql: ${TABLE}.total_crashes ;;
}

set: detail {
fields: [
client_id,
submission_date,
content_crash_count,
gpu_crash_count,
main_crash_count,
rdd_crash_count,
socket_crash_count,
utility_crash_count,
vr_crash_count,
total_crashes
]
}
}
94 changes: 94 additions & 0 deletions firefox_essentials/views/clients_daily_telemetry.view.lkml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@

view: clients_daily_telemetry {
derived_table: {
sql: select
date(submission_timestamp) as submission_date
,client_id
,sum(m1.payload.info.subsession_length/1000.00) as subsession_length_sec
,sum(m1.payload.processes.parent.scalars.browser_engagement_session_time_excluding_suspend)/1000.00 as engagement_time_sec
/* Video Consumption */
,coalesce(SUM(SAFE_CAST(JSON_EXTRACT_SCALAR(payload.processes.content.histograms.video_play_time_ms, "$.sum") AS int64)) / 1000.00,0) AS video_playtime_sec
,coalesce(SUM(SAFE_CAST(JSON_EXTRACT_SCALAR(payload.processes.content.histograms.video_hdr_play_time_ms, "$.sum") AS int64)) / 1000.00,0) AS video_hdr_playtime_sec
,coalesce(SUM(SAFE_CAST(JSON_EXTRACT_SCALAR(payload.processes.content.histograms.video_widevine_play_time_ms, "$.sum") AS int64)) / 1000.00,0) AS video_widevine_playtime_sec
,coalesce(SUM(SAFE_CAST(JSON_EXTRACT_SCALAR(payload.processes.content.histograms.video_encrypted_play_time_ms, "$.sum") AS int64)) / 1000.00,0) AS video_encrypted_playtime_sec
,coalesce(SUM(SAFE_CAST(JSON_EXTRACT_SCALAR(payload.processes.content.histograms.video_clearkey_play_time_ms, "$.sum") AS int64)) / 1000.00,0) AS video_clearkey_playtime_sec
/* Power Usage */
,coalesce(SUM(payload.processes.content.scalars.power_total_cpu_time_ms) / 1000.00,0) AS power_total_cpu_time_sec
from telemetry.main m1
where sample_id <= 4
and date(submission_timestamp) >= date_add(date_trunc(current_date, year), interval -2 year)
and normalized_channel = 'release'
group by 1,2;;
}

measure: count {
type: count
drill_fields: [detail*]
}

dimension: submission_date {
type: date
datatype: date
sql: ${TABLE}.submission_date ;;
}

dimension: client_id {
type: string
sql: ${TABLE}.client_id ;;
}

dimension: subsession_length_sec {
type: number
sql: ${TABLE}.subsession_length_sec ;;
}

dimension: engagement_time_sec {
type: number
sql: ${TABLE}.engagement_time_sec ;;
}

dimension: video_playtime_sec {
type: number
sql: ${TABLE}.video_playtime_sec ;;
}

dimension: video_hdr_playtime_sec {
type: number
sql: ${TABLE}.video_hdr_playtime_sec ;;
}

dimension: video_widevine_playtime_sec {
type: number
sql: ${TABLE}.video_widevine_playtime_sec ;;
}

dimension: video_encrypted_playtime_sec {
type: number
sql: ${TABLE}.video_encrypted_playtime_sec ;;
}

dimension: video_clearkey_playtime_sec {
type: number
sql: ${TABLE}.video_clearkey_playtime_sec ;;
}

dimension: power_total_cpu_time_sec {
type: number
sql: ${TABLE}.power_total_cpu_time_sec ;;
}

set: detail {
fields: [
submission_date,
client_id,
subsession_length_sec,
engagement_time_sec,
video_playtime_sec,
video_hdr_playtime_sec,
video_widevine_playtime_sec,
video_encrypted_playtime_sec,
video_clearkey_playtime_sec,
power_total_cpu_time_sec
]
}
}