Merge pull request #1774 from travis79/fix-ios-missing-quantitymetrictype

This commit is contained in:
Jan-Erik Rediger 2021-09-02 10:07:22 +02:00 коммит произвёл GitHub
Родитель 6eff40739a 289c1f9860
Коммит e92e346ba0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 12 добавлений и 4 удалений

Просмотреть файл

@ -29,6 +29,8 @@
5FE1C4CF24C0A676000CAA1A /* JweMetricTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FE1C4CE24C0A676000CAA1A /* JweMetricTests.swift */; };
5FE1C4D124C0A6A2000CAA1A /* JweMetric.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FE1C4D024C0A6A2000CAA1A /* JweMetric.swift */; };
97C5C1A423708C6700B79C93 /* ErrorType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97C5C1A323708C6700B79C93 /* ErrorType.swift */; };
AC06529C26E032E300D92D5E /* QuantityMetric.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC06529B26E032E300D92D5E /* QuantityMetric.swift */; };
AC06529E26E034BF00D92D5E /* QuantityMetricTypeTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC06529D26E034BF00D92D5E /* QuantityMetricTypeTest.swift */; };
AC1DB401237EF0ED005A0F8A /* Glean.h in Headers */ = {isa = PBXBuildFile; fileRef = BF3DE3942243A2F20018E23F /* Glean.h */; settings = {ATTRIBUTES = (Public, ); }; };
AC54D225233133DB0019319A /* PingUploadOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC54D224233133DB0019319A /* PingUploadOperation.swift */; };
AC54D227233134A30019319A /* GleanOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC54D226233134A30019319A /* GleanOperation.swift */; };
@ -104,6 +106,8 @@
5FE1C4CE24C0A676000CAA1A /* JweMetricTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JweMetricTests.swift; sourceTree = "<group>"; };
5FE1C4D024C0A6A2000CAA1A /* JweMetric.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JweMetric.swift; sourceTree = "<group>"; };
97C5C1A323708C6700B79C93 /* ErrorType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ErrorType.swift; sourceTree = "<group>"; };
AC06529B26E032E300D92D5E /* QuantityMetric.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QuantityMetric.swift; sourceTree = "<group>"; };
AC06529D26E034BF00D92D5E /* QuantityMetricTypeTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QuantityMetricTypeTest.swift; sourceTree = "<group>"; };
AC54D224233133DB0019319A /* PingUploadOperation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PingUploadOperation.swift; sourceTree = "<group>"; };
AC54D226233134A30019319A /* GleanOperation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GleanOperation.swift; sourceTree = "<group>"; };
BF10007D23548AF400064051 /* MemoryUnit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoryUnit.swift; sourceTree = "<group>"; };
@ -327,6 +331,7 @@
BF43A8C5232A4B5F00545310 /* Metrics */ = {
isa = PBXGroup;
children = (
AC06529B26E032E300D92D5E /* QuantityMetric.swift */,
1F6A8FEF233C049D007837D5 /* BooleanMetric.swift */,
BF43A8C6232A4BA400545310 /* CounterMetric.swift */,
1F6A8FF3233C0A91007837D5 /* DatetimeMetric.swift */,
@ -352,6 +357,7 @@
BF43A8CB232A613100545310 /* Metrics */ = {
isa = PBXGroup;
children = (
AC06529D26E034BF00D92D5E /* QuantityMetricTypeTest.swift */,
5FE1C4CE24C0A676000CAA1A /* JweMetricTests.swift */,
1F6A8FF1233C068A007837D5 /* BooleanMetricTypeTest.swift */,
BF43A8CC232A615200545310 /* CounterMetricTests.swift */,
@ -571,6 +577,7 @@
1FB70AEF23301C1D00C7CF09 /* Logger.swift in Sources */,
1F6A8FF0233C049D007837D5 /* BooleanMetric.swift in Sources */,
1F6A8FF4233C0A91007837D5 /* DatetimeMetric.swift in Sources */,
AC06529C26E032E300D92D5E /* QuantityMetric.swift in Sources */,
BFFE18382350A5F50068D97B /* TimingDistributionMetric.swift in Sources */,
BF89055F232BC213003CA2BA /* StringMetric.swift in Sources */,
BFFE183C2350A9CC0068D97B /* DistributionData.swift in Sources */,
@ -599,6 +606,7 @@
BFAED50A2369752400DF293D /* StringListMetricTests.swift in Sources */,
BF890561232BC227003CA2BA /* StringMetricTests.swift in Sources */,
BFCBD6AB246D55CC0032096D /* TestUtils.swift in Sources */,
AC06529E26E034BF00D92D5E /* QuantityMetricTypeTest.swift in Sources */,
1F58921223C923C4007D2D80 /* MetricsPingSchedulerTests.swift in Sources */,
1FD4527723395EEB00F4C7E8 /* UuidMetricTests.swift in Sources */,
BF80AA5B2399301300A8B172 /* HttpPingUploaderTests.swift in Sources */,

Просмотреть файл

@ -50,11 +50,11 @@ public class QuantityMetricType {
///
/// - parameters:
/// * value: The value to set. Must be non-negative.
public func set(_ value: Int32) {
public func set(_ value: Int64) {
guard !self.disabled else { return }
Dispatchers.shared.launchAPI {
glean_quantity_set(self.handle, amount)
glean_quantity_set(self.handle, value)
}
}
@ -83,7 +83,7 @@ public class QuantityMetricType {
/// Defaults to the first value in `sendInPings`.
///
/// - returns: value of the stored metric
public func testGetValue(_ pingName: String? = nil) throws -> Int32 {
public func testGetValue(_ pingName: String? = nil) throws -> Int64 {
Dispatchers.shared.assertInTestingMode()
let pingName = pingName ?? self.sendInPings[0]

Просмотреть файл

@ -46,7 +46,7 @@ class QuantityMetricTypeTests: XCTestCase {
XCTAssertFalse(quantityMetric.testHasValue())
quantityMetric.add(1)
quantityMetric.set(1)
XCTAssertFalse(quantityMetric.testHasValue(), "Quantities must not be recorded if they are disabled")
}