Created
March 24, 2016 16:43
-
-
Save Uberi/c626e601b12709b77cad to your computer and use it in GitHub Desktop.
pref analysis
This file contains hidden or 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[35]: | |
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, get_pings_properties, get_one_ping_per_client, get_clients_history, get_records | |
get_ipython().magic(u'pylab inline') | |
# In[2]: | |
sc.defaultParallelism | |
# In[20]: | |
pings = get_pings(sc, app="Firefox", channel="nightly", submission_date=("20160323", "20160323"), fraction=1) | |
# In[21]: | |
subset = get_pings_properties(pings, ["clientId", | |
"environment/settings/userPrefs/layers.offmainthreadcomposition.enabled"]) | |
# In[22]: | |
subset = get_one_ping_per_client(subset) | |
# In[23]: | |
subset.count() | |
# In[29]: | |
counts = subset.map(lambda p: p["environment/settings/userPrefs/layers.offmainthreadcomposition.enabled"]).countByValue() | |
# In[43]: | |
py.iplot({ | |
'data': [{'labels': ['Off-main-thread composition enabled', 'Off-main-thread composition disabled', 'Other'], | |
'values': [counts[None], counts[False], sum(counts.values()) - counts[None] - counts[False]], | |
'type': 'pie'}], | |
'layout': {'title': 'Off-main-thread composition setting'} | |
}, filename="pie-chart-plot", validate=False) | |
# The link might not show up on GitHub Gists, so here's a [direct link](https://plot.ly/412/~mozilla/). | |
# In[ ]: | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment