-
-
Save raymak/d18ed8fab091a7bf92c8a2ce17eb7191 to your computer and use it in GitHub Desktop.
Nothing Burger Addon Count
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[58]: | |
import ujson as json | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
import numpy as np | |
import plotly.plotly as py | |
from plotly.graph_objs import * | |
from moztelemetry import get_pings_properties, get_one_ping_per_client | |
from moztelemetry.dataset import Dataset | |
get_ipython().magic(u'matplotlib inline') | |
# In[59]: | |
sc.defaultParallelism | |
# In[60]: | |
_EXTENSION_IDS = [ | |
'optout-nothing-study-addon@shield.mozilla.com' | |
] | |
_START_DATE = '20170912' | |
_END_DATE = '20170920' | |
_SAMPLE = 1 | |
# In[61]: | |
Dataset.from_source("telemetry").schema | |
# In[62]: | |
pings = Dataset.from_source("telemetry") .where(docType='main') .where(submissionDate=lambda x: x <= _END_DATE and x >= _START_DATE) .where(appUpdateChannel="nightly") .records(sc, sample=_SAMPLE) | |
# In[63]: | |
subset = get_pings_properties(pings, {'clientId': "clientId", | |
'addons': "environment/addons/activeAddons"}) | |
# In[64]: | |
subset = subset.filter(lambda p: p.get('addons', None) is not None and len(p.get('addons', {}).keys()) > 0) | |
# In[ ]: | |
subset = get_one_ping_per_client(subset) | |
# How many pings have one of the legacy addons in them? | |
# In[ ]: | |
with_addons = subset.filter(lambda p: len(set(p['addons'].keys()) & set(_EXTENSION_IDS))>0) | |
with_addons_count = with_addons.count() | |
with_addons_count | |
# In[ ]: | |
# In[ ]: | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment