in lib/telemetry.py [0:0]
def getHistogramData(self, config, histogram):
slug = config['slug']
hist_name = histogram.split('.')[-1]
filename=os.path.join(self.dataDir, f"{slug}-{hist_name}.pkl")
df = self.checkForExistingData(filename)
if df is not None:
return df
if segments_are_all_OS(self.config['segments']):
if config["histograms"][histogram]["glean"]:
query = self.generateHistogramQuery_OS_segments_glean(histogram)
else:
query = self.generateHistogramQuery_OS_segments_legacy(histogram)
else:
# Generic segments are not well supported right now.
print("No current support for generic non-experiment queries.")
sys.exit(1)
print("Running query:\n" + query)
job = self.client.query(query)
df = job.to_dataframe()
print(f"Writing '{slug}' histogram results for {histogram} to disk.")
df.to_pickle(filename)
return df