You can set the interval for the IMQA MPM framework to save and collect data in seconds.
Objective-C
AppDelegate.m
IMQAConfig* mpmConfig = [[IMQAConfig alloc] init:@"PROJECT_KEY"];
mpmConfig.dump_interval = 10; // Interval of getting the performance data dump (sec)
mpmConfig.save_interval = 60; // Interval of sending performance data to the collection server (sec)
Swift
AppDelegate.swift
let mpmConfig =IMQAConfig("<PROJECT_KEY>")mpmConfig.dump_interval =10// Interval of getting the performance data dump (sec)mpmConfig.save_interval =60// Interval of sending performance data to the collection server (sec)
Setting the collection server
Clients who have selected an installation-type must perform this setting.
The collection server can be set separately, which sends data to be collected by the IMQA MPM framework. Basically, no separate settings are required for clients using SaaS.
let imqaUrl ="https://custom-url"let mpmConfig =IMQAConfig(PROJECT_KEY)mpmConfig.api_url = imqaUrl
Setting network collection
The IMQA MPM framework can set whether or not to collect network information. The framework also provides a function that can ignore the collection of a specific URL, which enables you to ignore the URL that requires security.
Objective-C
AppDelegate.m
IMQAConfig* mpmConfig = [[IMQAConfig alloc] init:@"PROJECT_KEY"];
mpmConfig.useNetworkCollect = YES; // YES: Collect, NO: Do not collec
mpmConfig.ignoreUrl = @[@"https://url1.com", @"http://url.com"]; // An array of specific URLs to ignore
Swift
AppDelegate.swift
let mpmConfig =IMQAConfig("<PROJECT_KEY>")mpmConfig.useNetworkCollect =true// true: Collect, false: Do not collectmpmConfig.ignoreUrl = ["https://url1.com", "http://url.com"] // An array of specific URLs to ignore
Checking collected data
If you want to check the data collected by the IMQA MPM framework, you can check the data on the console using its own options.
let mpmConfig =IMQAConfig("<PROJECT_KEY>")mpmConfig.downloadDumpData =true
2. Setting WKWebView
The IMQA MPM framework also collects the performance information of WKWebView. Please be noted that UIWebView is not supported due to the Apple policy.
Setting the web server (HTML)
The IMQA WebView JavaScript library should be inserted into a web page to collect WKWebView data. If you wish, you can also download the file and use it by adding a direct path to the web page.
For information on how to install the Agent when using MPM / WPM integration, refer to ‘IMQA WPM/WCrash Installation Guide > 1.2. Please refer to 'Using WPM / MPM integration (Installing WebAgent + WebviewAgent)'.
page.html
<!-- IMQA Webview Agent(ver. 1.1.3 earlier) --><scripttype="text/javascript"src="https://imqawebviewagent.blob.core.windows.net/agent/webview-agent-1.1.2.js"crossorigin></script>// If you want to apply it as a min file:<scripttype="text/javascript"src="https://imqawebviewagent.blob.core.windows.net/agent/webview-agent-1.1.2.min.js"crossorigin></script>
The WebView that requires performance collection requires the following settings. Additionally, error information occurring in WebView can be collected. To collect Webview Crash, you must add ImqaBridgeCrash.
let configuration = URLSessionConfiguration.ephemeral // or default
configuration.protocolClasses = IMQAMpm.sharedInstance.imqaURLSessionProtocol()
let session = URLSession.init(configuration: configuration)