Skip to content

Commit

Permalink
Fix view sql query for keyed histograms (#2879)
Browse files Browse the repository at this point in the history
* Fix view sql query for keyed histograms

* Formatting
  • Loading branch information
edugfilho authored Jun 26, 2024
1 parent 7edbab6 commit d2d06d1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/SqlModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,19 @@
}
let telemetryPath;
const histogramType = $store.aggKey ? 'keyed_histograms' : 'histograms';
const table =
$store.productDimensions.channel === 'nightly'
? 'main_nightly'
: 'main_1pct';
if ($store.probe.type === 'histogram') {
if (['main', 'parent'].includes(process)) {
telemetryPath = `payload.histograms.${$store.probe.name}`;
telemetryPath = `payload.${histogramType}.${$store.probe.name}`;
} else {
telemetryPath = `payload.processes.${process}.histograms.${$store.probe.name}`;
telemetryPath = `payload.processes.${process}.${histogramType}.${$store.probe.name}`;
}
if ($store.aggKey) {
telemetryPath = `mozfun.map.get_key(${telemetryPath}, ${$store.aggKey})`;
telemetryPath = `mozfun.map.get_key(${telemetryPath}, "${$store.aggKey}")`;
}
}
const osFilter =
Expand All @@ -103,7 +104,8 @@
: `AND normalized_os="${$store.productDimensions.os}"`;
const buildId = $store.ref || $store.defaultRef;
const normalized = $store.productDimensions.normalizationType === "normalized";
const normalized =
$store.productDimensions.normalizationType === 'normalized';
return _.template(sqlTemplate)({
metric: $store.probe.name,
Expand Down

0 comments on commit d2d06d1

Please sign in to comment.