setConfig method

Future<void> setConfig({
  1. double? sampleRate,
  2. TraceType? traceType,
  3. bool? enableLinkRUMData,
  4. bool? enableNativeAutoTrace,
  5. bool enableAutoTrace = false,
})

配置 trace sampleRate采样率 traceType 链路类型 enableLinkRUMData 是否与 RUM 数据关联 enableNativeAutoTrace 是否开启原生网络网络自动追踪 iOS NSURLSession ,Android OKhttp

Implementation

Future<void> setConfig(
    {double? sampleRate,
    TraceType? traceType,
    bool? enableLinkRUMData,
    bool? enableNativeAutoTrace,
    bool enableAutoTrace = false}) async {
  var map = Map<String, dynamic>();
  map["sampleRate"] = sampleRate;
  map["traceType"] = traceType?.index;
  map["enableLinkRUMData"] = enableLinkRUMData;
  map["enableNativeAutoTrace"] = enableNativeAutoTrace;
  internalConfig.traceHeader = enableAutoTrace;
  await channel.invokeMethod(methodTraceConfig, map);
}