Skip to content

Instantly share code, notes, and snippets.

@chutten
Last active May 11, 2016 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chutten/870e97c789096edb2752a67b23d3a079 to your computer and use it in GitHub Desktop.
Save chutten/870e97c789096edb2752a67b23d3a079 to your computer and use it in GitHub Desktop.
prelim_kill_hard
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# coding: utf-8
# ## SUBPROCESS_KILL_HARD
# In[1]:
from montecarlino import grouped_permutation_test
# In[2]:
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[3]:
sc.defaultParallelism
# In[14]:
pings = get_pings(sc, app="Firefox", channel="beta", version="47.0", build_id=("20160505000000", "20160511999999"), fraction=1)
# ... and extract only the attributes we need from the Telemetry submissions:
# In[15]:
subset = get_pings_properties(pings, ["clientId",
"environment/settings/e10sCohort",
"payload/keyedHistograms/SUBPROCESS_CRASHES_WITH_DUMP",
"payload/keyedHistograms/SUBPROCESS_KILL_HARD"], with_processes=True)
# In[16]:
subset = subset.filter(lambda p: p["environment/settings/e10sCohort"] in ["test", "control"])
# In[17]:
subset = subset.filter(lambda p: p["payload/keyedHistograms/SUBPROCESS_CRASHES_WITH_DUMP"] is not None)
# In[18]:
subset = get_one_ping_per_client(subset)
# In[19]:
cached = subset.cache()
# In[20]:
cached.count()
# In[21]:
cached.map(lambda p: (p["environment/settings/e10sCohort"], 1)).countByKey()
# In[22]:
def get_content_crashes(p):
crashes = p["payload/keyedHistograms/SUBPROCESS_CRASHES_WITH_DUMP"]
if crashes is not None and crashes.get("content", None) is not None:
return crashes["content"]
return 0
e10s_content_crashes = cached.filter(lambda p: p["environment/settings/e10sCohort"] == "test").map(get_content_crashes).reduce(lambda a, b: a + b)
none10s_content_crashes = cached.filter(lambda p: p["environment/settings/e10sCohort"] == "control").map(get_content_crashes).reduce(lambda a, b: a + b)
e10s_content_crashes, none10s_content_crashes
# In[23]:
def get_shutdown_kills(p):
kill_hards = p["payload/keyedHistograms/SUBPROCESS_KILL_HARD"]
if kill_hards is not None and kill_hards.get("ShutDownKill", None) is not None:
return kill_hards["ShutDownKill"]
return 0
e10s_shutdown_kills = cached.filter(lambda p: p["environment/settings/e10sCohort"] == "test").map(get_shutdown_kills).reduce(lambda a, b: a + b)
none10s_shutdown_kills = cached.filter(lambda p: p["environment/settings/e10sCohort"] == "control").map(get_shutdown_kills).reduce(lambda a, b: a + b)
e10s_shutdown_kills, none10s_shutdown_kills
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment