Network Analysis API

更新时间:
复制 MD 格式

This document describes the network analysis API for the Mobile Monitoring iOS SDK.

1. Configure network collection

Enable or disable network collection. This feature is enabled by default.

API reference

+ (void)setDataCollectionEnabled:(BOOL)dataCollectionEnabled;
+ (BOOL)dataCollectionEnabled;
class var dataCollectionEnabled: Bool { get set }

Code example

#import "AlicloudApmPerformance/AlicloudApmPerformance.h"

// Enable network collection.
[EAPMNetworkConfigurations setDataCollectionEnabled:YES];

// Get the status of network collection.
BOOL enabled = [EAPMNetworkConfigurations dataCollectionEnabled];
#import "AlicloudApmPerformance/AlicloudApmPerformance.h"

// Enable network collection.
EAPMNetworkConfigurations.dataCollectionEnabled = true

// Get the status of network collection.
let enabled = EAPMNetworkConfigurations.dataCollectionEnabled