Created
October 23, 2018 08:30
-
-
Save cpearce/00d26c4a00b0681e827014f408e2efd7 to your computer and use it in GitHub Desktop.
How many clients in WR study aren't reporting a set pref
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
# coding: utf-8 | |
# In[17]: | |
import ujson as json | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
import numpy as np | |
from moztelemetry.dataset import Dataset | |
from moztelemetry import get_pings_properties, get_one_ping_per_client | |
get_ipython().magic(u'matplotlib inline') | |
Dataset.from_source('telemetry').schema | |
# In[18]: | |
pings = ( | |
Dataset.from_source('telemetry') | |
.where(docType='main') | |
.where(submissionDate=lambda x: int(x) >= 20181010) | |
.where(appUpdateChannel="nightly") | |
.select(experiments='environment.experiments', | |
settings='environment.settings') | |
.records(sc, sample=1.0) | |
) | |
# In[19]: | |
pings_in_exp = pings.filter(lambda p: "experiments" in p and p["experiments"]).filter(lambda p: "prefflip-webrender-v1-2-1492568" in p["experiments"]) | |
num_pings = pings_in_exp.count() | |
# In[20]: | |
num_pings | |
# In[21]: | |
pings_without_pref = pings_in_exp.filter(lambda p: 'gfx.webrender.all.qualified' not in p['settings']['userPrefs']) | |
num_pings_without_pref = pings_without_pref.count() | |
num_pings_without_pref | |
# In[22]: | |
float(num_pings_without_pref) / float(num_pings) * 100.0 | |
# In[ ]: | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment