Skip to content

Instantly share code, notes, and snippets.

@georgf
Last active December 22, 2016 18:51
Show Gist options
  • Save georgf/60f11698dec0cfab91c7d112af255db1 to your computer and use it in GitHub Desktop.
Save georgf/60f11698dec0cfab91c7d112af255db1 to your computer and use it in GitHub Desktop.
Check moztelemetry types
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# coding: utf-8
# ## Check moztelemetry types
# In[1]:
import ujson as json
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import plotly.plotly as py
import datetime as dt
from uuid import UUID
from moztelemetry import get_pings, get_pings_properties, get_one_ping_per_client, get_clients_history
get_ipython().magic(u'pylab inline')
# We get all the pings on Beta, after bug 1293222 landed.
# In[15]:
def extract(pings):
subset = get_pings_properties(pings, ["meta/clientId",
"meta/documentId",
"payload/processes/parent",
"payload/processes/parent/events"])
return subset
pings = get_pings(sc,
app="Firefox",
channel="nightly",
doc_type="main",
submission_date="20161216",
build_id="20161210030206",
fraction=1.0)
extracts = extract(pings)
# In[24]:
ping = extracts.filter(lambda p: p["meta/documentId"] == "0aa23e4c-b779-f544-9c90-5193a4a44c59") .first()
# On my client i can clearly see that `payload/processes/parent/events` is `[]`.
#
# Extracting it here, it became a `dict` type instead of the expected `list`:
# In[25]:
ping["payload/processes/parent/events"]
# In[26]:
tmp = ping["payload/processes/parent"]
tmp["gc"] = {} # Readability ...
tmp["scalars"] = {} # Readability ...
tmp
# Skipping `get_pings_properties()`, the result is the same:
# In[27]:
ping = pings.filter(lambda p: p["meta"]["documentId"] == "0aa23e4c-b779-f544-9c90-5193a4a44c59") .first()
# In[28]:
ping["payload"]["processes"]["parent"]["events"]
@trink
Copy link

trink commented Dec 22, 2016

What about the new pipeline, this should not be an issue

FYI: it is correct in the new pipeline

    "processes": {
      "parent": {
        "scalars": {
          "browser.engagement.max_concurrent_tab_count": 2,
          "browser.engagement.max_concurrent_window_count": 2,
          "browser.engagement.unfiltered_uri_count": 14,
          "browser.engagement.tab_open_event_count": 1,
          "browser.engagement.unique_domains_count": 1,
          "browser.engagement.window_open_event_count": 1,
          "browser.engagement.total_uri_count": 14
        },
        "keyedScalars": {
          
        },
        "events": [
          
        ],
        "gc": {
          "random": [
            
          ],
          "worst": [

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment