Skip to content

Commit 30402d0

Browse files
committed
feat: add network tracking support
1 parent 9916a81 commit 30402d0

20 files changed

Lines changed: 1202 additions & 6 deletions

Amplitude-Swift.xcodeproj/project.pbxproj

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@
6363
BA9BEA4D299FB4BB00BC0F7C /* IdentifyInterceptorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA9BEA4C299FB4BB00BC0F7C /* IdentifyInterceptorTests.swift */; };
6464
D010435F2B6C59EE00F8173C /* SandboxHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = D010435E2B6C59EE00F8173C /* SandboxHelper.swift */; };
6565
D01043612B6C5A8500F8173C /* SandboxHelperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D01043602B6C5A8500F8173C /* SandboxHelperTests.swift */; };
66+
EA1F2CD92D8781950096A576 /* MethodSwizzlerTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA1F2CD82D8781950096A576 /* MethodSwizzlerTest.swift */; };
67+
EA5C95942D7A76B900DC8B3B /* NetworkSwizzler.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA5C95932D7A76B000DC8B3B /* NetworkSwizzler.swift */; };
68+
EA5C95962D7A776D00DC8B3B /* MethodSwizzler.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA5C95952D7A776200DC8B3B /* MethodSwizzler.swift */; };
69+
EA8DA4BF2D91C101003B00F0 /* NetworkTrackingPlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA8DA4BE2D91C101003B00F0 /* NetworkTrackingPlugin.swift */; };
70+
EA8DA4C12D91C131003B00F0 /* NetworkRequestEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA8DA4C02D91C131003B00F0 /* NetworkRequestEvent.swift */; };
71+
EAE891872DA83B6F00AB97D0 /* FakeURLProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAE891862DA83B6600AB97D0 /* FakeURLProtocol.swift */; };
72+
EAE989292DA831F200835345 /* NetworkTrackingPluginTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAE989282DA831F200835345 /* NetworkTrackingPluginTest.swift */; };
6673
OBJ_100 /* Mediator.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_21 /* Mediator.swift */; };
6774
OBJ_101 /* AmplitudeDestinationPlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_23 /* AmplitudeDestinationPlugin.swift */; };
6875
OBJ_102 /* ContextPlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_24 /* ContextPlugin.swift */; };
@@ -185,6 +192,13 @@
185192
BA9BEA4C299FB4BB00BC0F7C /* IdentifyInterceptorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IdentifyInterceptorTests.swift; sourceTree = "<group>"; };
186193
D010435E2B6C59EE00F8173C /* SandboxHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SandboxHelper.swift; sourceTree = "<group>"; };
187194
D01043602B6C5A8500F8173C /* SandboxHelperTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SandboxHelperTests.swift; sourceTree = "<group>"; };
195+
EA1F2CD82D8781950096A576 /* MethodSwizzlerTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MethodSwizzlerTest.swift; sourceTree = "<group>"; };
196+
EA5C95932D7A76B000DC8B3B /* NetworkSwizzler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkSwizzler.swift; sourceTree = "<group>"; };
197+
EA5C95952D7A776200DC8B3B /* MethodSwizzler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MethodSwizzler.swift; sourceTree = "<group>"; };
198+
EA8DA4BE2D91C101003B00F0 /* NetworkTrackingPlugin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkTrackingPlugin.swift; sourceTree = "<group>"; };
199+
EA8DA4C02D91C131003B00F0 /* NetworkRequestEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkRequestEvent.swift; sourceTree = "<group>"; };
200+
EAE891862DA83B6600AB97D0 /* FakeURLProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FakeURLProtocol.swift; sourceTree = "<group>"; };
201+
EAE989282DA831F200835345 /* NetworkTrackingPluginTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkTrackingPluginTest.swift; sourceTree = "<group>"; };
188202
OBJ_10 /* ConsoleLogger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConsoleLogger.swift; sourceTree = "<group>"; };
189203
OBJ_11 /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
190204
OBJ_12 /* EventBridge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventBridge.swift; sourceTree = "<group>"; };
@@ -328,13 +342,15 @@
328342
6C23EF142C38AC32000DC8C8 /* UIKitUserInteractionPluginTest.swift */,
329343
B6F338A22B685793006179E2 /* NetworkConnectivityCheckerPluginTests.swift */,
330344
4E2B646A2BA127460010E6F8 /* UIKitScreenViewsPluginTests.swift */,
345+
EAE989282DA831F200835345 /* NetworkTrackingPluginTest.swift */,
331346
);
332347
path = Plugins;
333348
sourceTree = "<group>";
334349
};
335350
OBJ_13 /* Events */ = {
336351
isa = PBXGroup;
337352
children = (
353+
EA8DA4C02D91C131003B00F0 /* NetworkRequestEvent.swift */,
338354
6C04FC3E2C58973C00EA8667 /* ElementInteractionEvent.swift */,
339355
OBJ_14 /* BaseEvent.swift */,
340356
OBJ_15 /* EventOptions.swift */,
@@ -352,6 +368,7 @@
352368
OBJ_22 /* Plugins */ = {
353369
isa = PBXGroup;
354370
children = (
371+
EA8DA4BE2D91C101003B00F0 /* NetworkTrackingPlugin.swift */,
355372
OBJ_23 /* AmplitudeDestinationPlugin.swift */,
356373
OBJ_24 /* ContextPlugin.swift */,
357374
OBJ_25 /* DestinationPlugin.swift */,
@@ -415,6 +432,8 @@
415432
OBJ_43 /* Utilities */ = {
416433
isa = PBXGroup;
417434
children = (
435+
EA5C95952D7A776200DC8B3B /* MethodSwizzler.swift */,
436+
EA5C95932D7A76B000DC8B3B /* NetworkSwizzler.swift */,
418437
OBJ_44 /* Atomic.swift */,
419438
OBJ_45 /* CodableExtension.swift */,
420439
OBJ_46 /* EventPipeline.swift */,
@@ -495,6 +514,7 @@
495514
OBJ_66 /* Supports */ = {
496515
isa = PBXGroup;
497516
children = (
517+
EAE891862DA83B6600AB97D0 /* FakeURLProtocol.swift */,
498518
OBJ_67 /* TestUtilities.swift */,
499519
);
500520
path = Supports;
@@ -539,6 +559,7 @@
539559
8EDEC4F83BFAA664749FAEF0 /* QueueTimeTests.swift */,
540560
D01043602B6C5A8500F8173C /* SandboxHelperTests.swift */,
541561
3E281B8D2B96833D009D913B /* DiagnosticsTests.swift */,
562+
EA1F2CD82D8781950096A576 /* MethodSwizzlerTest.swift */,
542563
);
543564
path = Utilities;
544565
sourceTree = "<group>";
@@ -699,6 +720,7 @@
699720
BA9BEA4D299FB4BB00BC0F7C /* IdentifyInterceptorTests.swift in Sources */,
700721
OBJ_149 /* RevenueEventTests.swift in Sources */,
701722
OBJ_150 /* RevenueTests.swift in Sources */,
723+
EAE891872DA83B6F00AB97D0 /* FakeURLProtocol.swift in Sources */,
702724
OBJ_151 /* PersistentStorageTests.swift in Sources */,
703725
OBJ_152 /* TestUtilities.swift in Sources */,
704726
6C23EF162C38AD31000DC8C8 /* UIKitUserInteractionPluginTest.swift in Sources */,
@@ -713,12 +735,14 @@
713735
OBJ_157 /* PersistentStorageResponseHandlerTests.swift in Sources */,
714736
4E05BB942BE41AEB009DE475 /* Amplitude+Extensions.swift in Sources */,
715737
OBJ_158 /* UrlExtensionTests.swift in Sources */,
738+
EAE989292DA831F200835345 /* NetworkTrackingPluginTest.swift in Sources */,
716739
8EDEC4EE0DE1C89889F451B5 /* QueueTimeTests.swift in Sources */,
717740
BA1EC0F62A9F63FD00C2D547 /* AmplitudeIOSTests.swift in Sources */,
718741
8EDEC14255F82E24CEE00B36 /* AmplitudeSessionTests.swift in Sources */,
719742
8EDEC972AEB33E4528F7FEEB /* StoragePrefixMigrationTests.swift in Sources */,
720743
4E2B646B2BA127460010E6F8 /* UIKitScreenViewsPluginTests.swift in Sources */,
721744
BA994B9A2A4F48DE00D0913F /* LegacyDatabaseStorageTests.swift in Sources */,
745+
EA1F2CD92D8781950096A576 /* MethodSwizzlerTest.swift in Sources */,
722746
8EDEC2E0CC80DF79F5463ACC /* RemnantDataMigrationTests.swift in Sources */,
723747
);
724748
runOnlyForDeploymentPostprocessing = 0;
@@ -755,12 +779,14 @@
755779
3E281B912B9BCC14009D913B /* DispatchQueueHolder.swift in Sources */,
756780
B605396A2BB767390027FC24 /* DefaultEventUtils.swift in Sources */,
757781
OBJ_112 /* PersistentStorage.swift in Sources */,
782+
EA5C95942D7A76B900DC8B3B /* NetworkSwizzler.swift in Sources */,
758783
BA9BEA4B299FB43B00BC0F7C /* IdentifyInterceptor.swift in Sources */,
759784
BA0639F62A4DD491000F1CEE /* LegacyDatabaseStorage.swift in Sources */,
760785
OBJ_113 /* Timeline.swift in Sources */,
761786
OBJ_114 /* TrackingOptions.swift in Sources */,
762787
OBJ_115 /* Types.swift in Sources */,
763788
OBJ_116 /* Atomic.swift in Sources */,
789+
EA5C95962D7A776D00DC8B3B /* MethodSwizzler.swift in Sources */,
764790
OBJ_117 /* CodableExtension.swift in Sources */,
765791
OBJ_118 /* EventPipeline.swift in Sources */,
766792
6C04FC412C58974A00EA8667 /* UIKitElementInteractions.swift in Sources */,
@@ -773,6 +799,7 @@
773799
3E281B8C2B967F19009D913B /* Diagonostics.swift in Sources */,
774800
8EDECD602E181B3E2E85D4DF /* StoragePrefixMigration.swift in Sources */,
775801
8EDEC8F8DD2CDCD6568512F8 /* RemnantDataMigration.swift in Sources */,
802+
EA8DA4C12D91C131003B00F0 /* NetworkRequestEvent.swift in Sources */,
776803
8EDEC977C03AA2676724F436 /* BasePlugins.swift in Sources */,
777804
8EDEC1073A308B12B5CCD975 /* AnalyticsConnectorPlugin.swift in Sources */,
778805
D010435F2B6C59EE00F8173C /* SandboxHelper.swift in Sources */,
@@ -783,6 +810,7 @@
783810
6C04FC432C58976800EA8667 /* ObjCAutocaptureOptions.swift in Sources */,
784811
8EDEC43FB30802F70112E577 /* ScreenViewedEvent.swift in Sources */,
785812
8EDEC51F746CC25D27E32F6A /* DeepLinkOpenedEvent.swift in Sources */,
813+
EA8DA4BF2D91C101003B00F0 /* NetworkTrackingPlugin.swift in Sources */,
786814
8EDECF81C2B1B38D472FD7EF /* ObjCConfiguration.swift in Sources */,
787815
8EDECB800546E37719391E65 /* ObjCPlan.swift in Sources */,
788816
8EDEC02B99EE2092B567A61D /* ObjCIngestionMetadata.swift in Sources */,

Examples/AmplitudeSwiftUIExample/AmplitudeSwiftUIExample/AmplitudeSwiftUIExampleApp.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ extension Amplitude {
7979
},
8080
trackingOptions: TrackingOptions().disableTrackCarrier().disableTrackDMA(),
8181
flushEventsOnClose: true,
82-
minTimeBetweenSessionsMillis: 15000
82+
minTimeBetweenSessionsMillis: 15000,
83+
autocapture: [.sessions, .networkTracking]
8384
)
8485
)
8586

Examples/AmplitudeSwiftUIExample/AmplitudeSwiftUIExample/ContentView.swift

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ struct ContentView: View {
2727
@State var groupProperty = ""
2828
@State var groupUserPropertyKey = ""
2929
@State var groupUserPropertyValue = ""
30+
@State var responseCode = "500"
31+
@State var responseDelay = "0"
3032

3133
var body: some View {
3234
VStack {
@@ -132,6 +134,19 @@ struct ContentView: View {
132134
Text("Send Group Identify Event")
133135
}.buttonStyle(AmplitudeButton())
134136
}
137+
Section(header: Text("NETWORK TRACKING TEST")) {
138+
HStack {
139+
TextField("Response Code", text: $responseCode)
140+
.keyboardType(.numberPad)
141+
TextField("Delay in ms", text: $responseDelay)
142+
.keyboardType(.numberPad)
143+
}
144+
Button(action: {
145+
requestNetwork(responseCode: responseCode, responseDelay: responseDelay)
146+
}) {
147+
Text("Request Network")
148+
}.buttonStyle(AmplitudeButton())
149+
}
135150
Button(action: {
136151
Amplitude.testInstance.flush()
137152
}) {
@@ -165,3 +180,17 @@ struct ContentView_Previews: PreviewProvider {
165180
ContentView().environment(\.managedObjectContext, PersistenceController.preview.container.viewContext)
166181
}
167182
}
183+
184+
func requestNetwork(responseCode: String, responseDelay: String) {
185+
let url = URL(string: "https://httpstat.us/\(responseCode)?sleep=\(responseDelay)#test")
186+
let request = URLRequest(url: url!)
187+
let session = URLSession.shared
188+
let task = session.dataTask(with: request) { data, response, error in
189+
print("Response: \(response)")
190+
if let error = error {
191+
print("Error: \(error)")
192+
}
193+
}
194+
task.resume()
195+
print("Request sent: \(url)")
196+
}

Examples/AmplitudeSwiftUIExample/AmplitudeSwiftUIExample/ExamplePlugins/LocationPlugin.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ import CoreLocation
66
/// This plugin example currently supports iOS 14+ only.
77
/// Don't forget to add "NSLocationWhenInUseUsageDescription" with a description to your Info.plist.
88
class LocationPlugin: NSObject, Plugin, CLLocationManagerDelegate {
9+
func onUserIdChanged(_ userId: String?) {
10+
}
11+
12+
func onDeviceIdChanged(_ deviceId: String?) {
13+
}
14+
15+
func onSessionIdChanged(_ sessionId: Int64) {
16+
}
17+
18+
func onOptOutChanged(_ optOut: Bool) {
19+
}
20+
921
let type = PluginType.enrichment
1022
weak var amplitude: Amplitude? = nil
1123
private var locationManager: CLLocationManager? = nil

Examples/AmplitudeSwiftUIExample/AmplitudeSwiftUIExample/ExamplePlugins/TroubleShootingPlugin.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ class TroubleShootingPlugin: DestinationPlugin {
2020

2121
open override func track(event: BaseEvent) -> BaseEvent? {
2222
let jsonEncoder = JSONEncoder()
23+
jsonEncoder.outputFormatting = .prettyPrinted
2324
let eventJsonData = try! jsonEncoder.encode(event)
2425
let eventJson = String(data: eventJsonData, encoding: String.Encoding.utf8)
25-
26-
self.amplitude?.logger?.debug(message: "Processed event: \(String(describing: eventJson))")
26+
27+
self.amplitude?.logger?.debug(message: "Processed event: \(eventJson ?? "")")
2728
return event
2829
}
2930
}

Package.resolved

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sources/Amplitude/Amplitude.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,15 @@ public class Amplitude {
7575
_ = add(plugin: AnalyticsConnectorPlugin())
7676
_ = add(plugin: AnalyticsConnectorIdentityPlugin())
7777
_ = add(plugin: AmplitudeDestinationPlugin())
78+
_ = add(plugin: NetworkTrackingPlugin())
7879

7980
// Monitor changes to optOut to send to Timeline
8081
configuration.optOutChanged = { [weak self] optOut in
8182
self?.timeline.onOptOutChanged(optOut)
8283
}
8384

85+
NetworkSwizzler.shared.swizzle()
86+
8487
trackingQueue.async { [self] in
8588
self.trimQueuedEvents()
8689
}

Sources/Amplitude/AutocaptureOptions.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,13 @@ public struct AutocaptureOptions: OptionSet {
1111
public static let appLifecycles = AutocaptureOptions(rawValue: 1 << 1)
1212
public static let screenViews = AutocaptureOptions(rawValue: 1 << 2)
1313
public static let elementInteractions = AutocaptureOptions(rawValue: 1 << 3)
14+
public static let networkTracking = AutocaptureOptions(rawValue: 1 << 4)
15+
16+
public static let all: AutocaptureOptions = [
17+
.sessions,
18+
.appLifecycles,
19+
.screenViews,
20+
.elementInteractions,
21+
.networkTracking
22+
]
1423
}

Sources/Amplitude/Configuration.swift

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,15 @@ public class Configuration {
4646
}
4747
}
4848
public internal(set) var autocapture: AutocaptureOptions
49+
public internal(set) var networkTrackingOptions: NetworkTrackingOptions
4950
public var offline: Bool?
5051
internal let diagonostics: Diagnostics
5152
public var maxQueuedEventCount = -1
5253
var optOutChanged: ((Bool) -> Void)?
5354

55+
// For Unit Test
56+
var urlProtocolClass: URLProtocol.Type?
57+
5458
@available(*, deprecated, message: "Please use the `autocapture` parameter instead.")
5559
public convenience init(
5660
apiKey: String,
@@ -79,7 +83,8 @@ public class Configuration {
7983
defaultTracking: DefaultTrackingOptions,
8084
identifyBatchIntervalMillis: Int = Constants.Configuration.IDENTIFY_BATCH_INTERVAL_MILLIS,
8185
migrateLegacyData: Bool = true,
82-
offline: Bool? = false
86+
offline: Bool? = false,
87+
networkTrackingOptions: NetworkTrackingOptions = .defaultOptions()
8388
) {
8489
self.init(apiKey: apiKey,
8590
flushQueueSize: flushQueueSize,
@@ -106,7 +111,8 @@ public class Configuration {
106111
autocapture: defaultTracking.autocaptureOptions,
107112
identifyBatchIntervalMillis: identifyBatchIntervalMillis,
108113
migrateLegacyData: migrateLegacyData,
109-
offline: offline)
114+
offline: offline,
115+
networkTrackingOptions: networkTrackingOptions)
110116
self.defaultTracking = defaultTracking
111117
}
112118

@@ -138,7 +144,8 @@ public class Configuration {
138144
identifyBatchIntervalMillis: Int = Constants.Configuration.IDENTIFY_BATCH_INTERVAL_MILLIS,
139145
maxQueuedEventCount: Int = -1,
140146
migrateLegacyData: Bool = true,
141-
offline: Bool? = false
147+
offline: Bool? = false,
148+
networkTrackingOptions: NetworkTrackingOptions = .defaultOptions(),
142149
) {
143150
let normalizedInstanceName = Configuration.getNormalizeInstanceName(instanceName)
144151

@@ -174,6 +181,7 @@ public class Configuration {
174181
// Logging is OFF by default
175182
self.loggerProvider.logLevel = logLevel.rawValue
176183
self.offline = offline
184+
self.networkTrackingOptions = networkTrackingOptions
177185
}
178186

179187
func isValid() -> Bool {

Sources/Amplitude/Constants.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ public struct Constants {
8484
static let AMP_DEEP_LINK_OPENED_EVENT = "\(AMP_AMPLITUDE_PREFIX)Deep Link Opened"
8585
static let AMP_SCREEN_VIEWED_EVENT = "\(AMP_AMPLITUDE_PREFIX)Screen Viewed"
8686
static let AMP_ELEMENT_INTERACTED_EVENT = "\(AMP_AMPLITUDE_PREFIX)Element Interacted"
87+
static let AMP_NETWORK_TRACKING_EVENT = "\(AMP_AMPLITUDE_PREFIX)Network Tracking"
8788

8889
static let AMP_REVENUE_EVENT = "revenue_amount"
8990

@@ -104,6 +105,19 @@ public struct Constants {
104105
static let AMP_APP_ACTION_METHOD_PROPERTY = "\(AMP_AMPLITUDE_PREFIX)Action Method"
105106
static let AMP_APP_GESTURE_RECOGNIZER_PROPERTY = "\(AMP_AMPLITUDE_PREFIX)Gesture Recognizer"
106107

108+
static let AMP_NETWORK_URL_PROPERTY = "\(AMP_AMPLITUDE_PREFIX)URL"
109+
static let AMP_NETWORK_URL_QUERY_PROPERTY = "\(AMP_AMPLITUDE_PREFIX)URL Query"
110+
static let AMP_NETWORK_URL_FRAGMENT_PROPERTY = "\(AMP_AMPLITUDE_PREFIX)URL Fragment"
111+
static let AMP_NETWORK_REQUEST_METHOD_PROPERTY = "\(AMP_AMPLITUDE_PREFIX)Request Method"
112+
static let AMP_NETWORK_STATUS_CODE_PROPERTY = "\(AMP_AMPLITUDE_PREFIX)Status Code"
113+
static let AMP_NETWORK_ERROR_CODE_PROPERTY = "\(AMP_AMPLITUDE_PREFIX)Error Code"
114+
static let AMP_NETWORK_ERROR_MESSAGE_PROPERTY = "\(AMP_AMPLITUDE_PREFIX)Error Message"
115+
static let AMP_NETWORK_START_TIME_PROPERTY = "\(AMP_AMPLITUDE_PREFIX)Start Time"
116+
static let AMP_NETWORK_COMPLETION_TIME_PROPERTY = "\(AMP_AMPLITUDE_PREFIX)Completion Time"
117+
static let AMP_NETWORK_DURATION_PROPERTY = "\(AMP_AMPLITUDE_PREFIX)Duration"
118+
static let AMP_NETWORK_REQUEST_BODY_SIZE_PROPERTY = "\(AMP_AMPLITUDE_PREFIX)Request Body Size"
119+
static let AMP_NETWORK_RESPONSE_BODY_SIZE_PROPERTY = "\(AMP_AMPLITUDE_PREFIX)Response Body Size"
120+
107121
public struct Configuration {
108122
public static let FLUSH_QUEUE_SIZE = 30
109123
public static let FLUSH_INTERVAL_MILLIS = 30 * 1000 // 30s

0 commit comments

Comments
 (0)