Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Update to GeckoView Nightly 125.0.20240313094814 on main #6005

Merged
merged 5 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

package mozilla.components.service.glean.private

import androidx.annotation.VisibleForTesting

typealias CommonMetricData = mozilla.telemetry.glean.private.CommonMetricData
typealias EventExtras = mozilla.telemetry.glean.private.EventExtras
typealias Lifetime = mozilla.telemetry.glean.private.Lifetime
Expand All @@ -16,7 +18,6 @@ typealias CounterMetricType = mozilla.telemetry.glean.private.CounterMetricType
typealias CustomDistributionMetricType = mozilla.telemetry.glean.private.CustomDistributionMetricType
typealias DatetimeMetricType = mozilla.telemetry.glean.private.DatetimeMetricType
typealias DenominatorMetricType = mozilla.telemetry.glean.private.DenominatorMetricType
typealias EventMetricType<T> = mozilla.telemetry.glean.private.EventMetricType<T>
typealias HistogramMetricBase = mozilla.telemetry.glean.private.HistogramBase
typealias HistogramType = mozilla.telemetry.glean.private.HistogramType
typealias LabeledMetricType<T> = mozilla.telemetry.glean.private.LabeledMetricType<T>
Expand All @@ -35,3 +36,84 @@ typealias TimespanMetricType = mozilla.telemetry.glean.private.TimespanMetricTyp
typealias TimingDistributionMetricType = mozilla.telemetry.glean.private.TimingDistributionMetricType
typealias UrlMetricType = mozilla.telemetry.glean.private.UrlMetricType
typealias UuidMetricType = mozilla.telemetry.glean.private.UuidMetricType

// FIXME(bug 1885170): Wrap the Glean SDK `EventMetricType` to overwrite the `testGetValue` function.
/**
* This implements the developer facing API for recording events.
*
* Instances of this class type are automatically generated by the parsers at built time,
* allowing developers to record events that were previously registered in the metrics.yaml file.
*
* The Events API only exposes the [record] method, which takes care of validating the input
* data and making sure that limits are enforced.
*/
class EventMetricType<ExtraObject> internal constructor(
private var inner: mozilla.telemetry.glean.private.EventMetricType<ExtraObject>,
) where ExtraObject : EventExtras {
/**
* The public constructor used by automatically generated metrics.
*/
constructor(meta: CommonMetricData, allowedExtraKeys: List<String>) :
this(inner = mozilla.telemetry.glean.private.EventMetricType(meta, allowedExtraKeys))

/**
* Record an event by using the information provided by the instance of this class.
*
* @param extra The event extra properties.
* Values are converted to strings automatically
* This is used for events where additional richer context is needed.
* The maximum length for values is 100 bytes.
*
* Note: `extra` is not optional here to avoid overlapping with the above definition of `record`.
* If no `extra` data is passed the above function will be invoked correctly.
*/
fun record(extra: ExtraObject? = null) {
inner.record(extra)
}

/**
* Returns the stored value for testing purposes only. This function will attempt to await the
* last task (if any) writing to the the metric's storage engine before returning a value.
*
* @param pingName represents the name of the ping to retrieve the metric for.
* Defaults to the first value in `sendInPings`.
* @return value of the stored events
*/
@VisibleForTesting(otherwise = VisibleForTesting.NONE)
@JvmOverloads
fun testGetValue(pingName: String? = null): List<mozilla.telemetry.glean.private.RecordedEvent>? {
var events = inner.testGetValue(pingName)
if (events == null) {
return events
}

// Remove the `glean_timestamp` extra.
// This is added by Glean and does not need to be exposed to testing.
for (event in events) {
if (event.extra == null) {
continue
}

// We know it's not null
var map = event.extra!!.toMutableMap()
map.remove("glean_timestamp")
if (map.isEmpty()) {
event.extra = null
} else {
event.extra = map
}
}

return events
}

/**
* Returns the number of errors recorded for the given metric.
*
* @param errorType The type of the error recorded.
* @return the number of errors recorded for the metric.
*/
@VisibleForTesting(otherwise = VisibleForTesting.NONE)
fun testGetNumRecordedErrors(errorType: mozilla.components.service.glean.testing.ErrorType) =
inner.testGetNumRecordedErrors(errorType)
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

// These lines are generated by android-components/automation/application-services-nightly-bump.py
val VERSION = "125.20240309050254"
val VERSION = "125.20240313050306"
val CHANNEL = ApplicationServicesChannel.NIGHTLY

object ApplicationServicesConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ object Versions {
const val leakcanary = "2.13"

// DO NOT MODIFY MANUALLY. This is auto-updated along with GeckoView.
const val mozilla_glean = "58.0.0"
const val mozilla_glean = "58.1.0"

const val material = "1.9.0"
const val ksp = "1.0.17"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ object Gecko {
/**
* GeckoView Version.
*/
const val version = "125.0.20240312214346"
const val version = "125.0.20240313094814"

/**
* GeckoView channel
Expand Down
Loading