앱 개발 및 테스트 중에 Performance Monitoring을 사용 중지하는 것이 유용할 수 있습니다.
예를 들어 앱 빌드 시 Performance Monitoring을 사용 중지하여 다음 작업을 할 수 있습니다.
디버그 빌드에서는 Performance Monitoring의 특정 기능을 사용 중지하고 출시 빌드에서는 기능을 다시 사용 설정합니다.
앱을 빌드할 때 Performance Monitoring을 사용 중지하고 런타임에 앱에서 다시 사용 설정하도록 허용합니다.
앱을 빌드할 때 Performance Monitoring을 사용 중지하고 런타임에 앱에서 다시 사용 설정하도록 허용하지 않습니다.
또한 Performance Monitoring을 사용 설정한 상태에서 앱을 빌드하고 Firebase 원격 구성을 사용하여 프로덕션 앱에서 Performance Monitoring을 원하는 대로 사용 중지하고 다시 사용 설정할 수 있습니다. 이 옵션을 통해 사용자가 Performance Monitoring 사용 여부를 선택할 수 있도록 앱을 구성할 수도 있습니다.
앱 빌드 시 Performance Monitoring 사용 중지
예를 들어 앱 개발 및 테스트 중에 출시 전 버전 앱의 성능 데이터가 보고되지 않게 하려면 앱 빌드 프로세스에서는 Performance Monitoring을 사용 중지하면 됩니다.
이렇게 하려면 플랫폼별 iOS+ 및 Android 문서를 참조하세요.
원격 구성을 사용하여 런타임에 앱 사용 중지
Firebase 원격 구성은 앱의 동작과 모양을 변경할 수 있으므로 앱의 배포된 인스턴스에서 Performance Monitoring을 사용 중지하는 이상적인 방법을 제공합니다.
예를 들어 perf_disable이라는 파라미터를 사용하여 Performance Monitoring을 원격으로 제어하려고 합니다. 시작 코드에 다음을 추가하여 Performance Monitoring을 사용 설정하거나 사용 중지합니다.
// Activate previously-fetched values, falling back on the defaults if
// nothing is available yet.
await FirebaseRemoteConfig.instance
.setDefaults(YOUR_REMOTE_CONFIG_DEFAULTS);
await FirebaseRemoteConfig.instance.activate();
// Enable or disable Performance Monitoring based on the value of
// "perf_disable".
final perfMonDisabled =
FirebaseRemoteConfig.instance.getBool("perf_disable");
FirebasePerformance.instance
.setPerformanceCollectionEnabled(!perfMonDisabled);
// Fetch values for next time. (Don't await the result!)
FirebaseRemoteConfig.instance.fetch();