Commit a89cf05a authored by Alessio Placitelli's avatar Alessio Placitelli
Browse files

Enable Gecko scalars exfiltration in engine-gecko

This enables exfiltrating Gecko scalars defined in
Gecko in products using both engine-gecko and the
Glean SDK.
parent f5158da6
......@@ -4,7 +4,7 @@
package mozilla.components.browser.engine.gecko.glean
import mozilla.components.browser.engine.gecko.GleanMetrics.GleanGeckoHistogramMapping
import mozilla.components.browser.engine.gecko.GleanMetrics.GleanGeckoMetricsMapping
import org.mozilla.geckoview.RuntimeTelemetry
/**
......@@ -20,8 +20,8 @@ import org.mozilla.geckoview.RuntimeTelemetry
*/
class GeckoAdapter : RuntimeTelemetry.Delegate {
override fun onTelemetryReceived(metric: RuntimeTelemetry.Metric) {
// Note that the `GleanGeckoHistogramMapping` is automatically generated at
// Note that the `GleanGeckoMetricsMapping` is automatically generated at
// build time by the Glean SDK parsers.
GleanGeckoHistogramMapping[metric.name]?.accumulateSamples(metric.values)
GleanGeckoMetricsMapping.getHistogram(metric.name)?.accumulateSamples(metric.values)
}
}
......@@ -4,7 +4,7 @@
package mozilla.components.browser.engine.gecko.glean
import mozilla.components.browser.engine.gecko.GleanMetrics.GleanGeckoHistogramMapping
import mozilla.components.browser.engine.gecko.GleanMetrics.GleanGeckoMetricsMapping
import org.mozilla.geckoview.RuntimeTelemetry
/**
......@@ -22,6 +22,18 @@ class GeckoAdapter : RuntimeTelemetry.Delegate {
override fun onHistogram(metric: RuntimeTelemetry.Metric<LongArray>) {
// Note that the `GleanGeckoHistogramMapping` is automatically generated at
// build time by the Glean SDK parsers.
GleanGeckoHistogramMapping[metric.name]?.accumulateSamples(metric.value)
GleanGeckoMetricsMapping.getHistogram(metric.name)?.accumulateSamples(metric.value)
}
override fun onBooleanScalar(metric: RuntimeTelemetry.Metric<Boolean>) {
GleanGeckoMetricsMapping.getBooleanScalar(metric.name)?.set(metric.value)
}
override fun onStringScalar(metric: RuntimeTelemetry.Metric<String>) {
GleanGeckoMetricsMapping.getStringScalar(metric.name)?.set(metric.value)
}
override fun onLongScalar(metric: RuntimeTelemetry.Metric<Long>) {
GleanGeckoMetricsMapping.getQuantityScalar(metric.name)?.set(metric.value)
}
}
......@@ -21,7 +21,7 @@ import org.gradle.api.internal.artifacts.ArtifactAttributes
// so that it will be shared between all libraries that use Glean. This is
// important because it is approximately 300MB in installed size.
String GLEAN_PARSER_VERSION = "1.4.2"
String GLEAN_PARSER_VERSION = "1.5.1"
// The version of Miniconda is explicitly specified.
// Miniconda3-4.5.12 is known to not work on Windows.
String MINICONDA_VERSION = "4.5.11"
......
......@@ -71,6 +71,9 @@ permalink: /changelog/
* **feature-pwa**
* Adds the ability to create a basic shortcut with a custom label
* **browser-engine-gecko-nightly**
* Adds support for exposing Gecko scalars through the Glean SDK. See [bug 1579365](https://bugzilla.mozilla.org/show_bug.cgi?id=1579365) for details.
# 11.0.0
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment