iOS的应用火力地堡性能监测/ HTTPMetric不工作

时间:2019-01-31 11:13:05

标签: ios swift firebase firebase-performance

我们同时使用 FireBase应用性能监控 HTTPMetric 来监控api。但是两者都不起作用。下面是示例代码。

let trace = Performance.startTrace(name: Constants.PerformanceMonitoring().apiCall)
trace?.setValue(urlString!, forAttribute: Constants.PerformanceMonitoring().url)
// guard let metric = HTTPMetric(url: URL.init(string: urlString!)!, httpMethod: .post) else { return }
// metric.setValue(urlString!, forAttribute: Constants.PerformanceMonitoring().url)
// metric.start()

HTTPClient().postData(urlString ?? "", paramaters: Parameters, isHeaders: isHeaders , success: { (success) in

    trace?.stop()
    // metric.responseCode = success?.responseCode ?? 0
    // metric.responsePayloadSize = success?.responsePayloadSize ?? 0
    // metric.requestPayloadSize = success?.requestPayloadSize ?? 0
    // metric.stop()

    let modal = APIHandler().handleUrl(urlString ?? "", response: success ?? "" as AnyObject)
    successResponse(modal)

}, failure: { (failure) in
    trace?.stop()
    failureResponse(failure)
})

0 个答案:

没有答案