Upgrade to Pro — share decks privately, control downloads, hide ads and more …

파이어베이스로 서비스 품질 올리기

파이어베이스로 서비스 품질 올리기

대한민국 인공지능위크 2023 모바일 안드로이드 트랙에서 발표한 자료 입니다.
참석 해주신 분들 감사합니다!
https://rsvp.withgoogle.com/events/aiweek2023

Veronikapj

July 14, 2023
Tweet

More Decks by Veronikapj

Other Decks in Programming

Transcript

  1. GWP-ASan Crashlytics <application android:gwpAsanMode=“always" . . . /> AndroidManifest.xml Android

    11 ੉࢚ https://developer.android.com/ndk/guides/gwp-asan?hl=ko C++ Memory bugs Android Native Memory ࢎਊ Bug ଺ӝ NDK
  2. Firebase Performance Monitoring জ द੘ दр ஏ੿ HTTP ֎౟ਕ௼ ਃ୒

    ੗ز ஏ੿ Ҵо, ӝӝ জ ߡ੹ ١ ࣘࢿী ٮۄ ஏ੿ػ ࢿמ ࠙ܨ Custom Trace ࢿמ ঌܿ ࢸ੿
  3. ੗ز ஏ੿ Trace 4 1 ࢎਊ੗о জਸ ৈח द੼ (௒٘

    झఋ౟) ୐ߣ૩ Activity onResume() ݃૑݄ Activity onStop() Foreground Activity onResume() 3 2 FirebasePerfProvider ContentProvider onCreate() Performance
  4. 4 1 ࢎਊ੗о জਸ ৈח द੼ (௒٘ झఋ౟) ୐ߣ૩ Activity

    onResume() ݃૑݄ Activity onStop() Foreground Activity onResume() 3 2 FirebasePerfProvider ContentProvider onCreate() _app_start _app_in_foreground _app_in_background Performance ੗ز ஏ੿ Trace
  5. জ द੘ दр ஏ੿җ ҙܻо ೙ਃೠ ੉ਬ? জী ؀ೠ ୐

    ੋ࢚ਸ ઝ਋ 30 % 2.4 % ࡈۄ૓ জ द੘ दр Ѩ࢝ ૐо Source: goo.gle/3JCc453 জ द੘ दр ஏ੿
  6. Performance Trace ࣘࢿ ؘ੉ఠ ೙ఠ݂ • জ ߡ੹ • ੉੹

    ߡ੹, ୭न ୹द ߡ੹җ ࠺Ү • ӝӝ ߹ • ٣߄੉झ ߹ ࢎনী ٮۄ • Ҵо ߹ • ؘ੉ఠ ߬੉झ ਤ஖о ౠ੿ ૑৉ী ৔ೱਸ ޷஖૑ח ঋח૑
  7. Performance Trace ࣁ࣌ ࢚ࣁ ࠁӝ CPU, Memory, Trace ߂ Network

    Request https://firebase.blog/posts/2018/11/ firebase-performance-monitoring
  8. Performance Trace ઺ী CPU झ౵੉௼о ߊࢤೣ Trace ࣁ࣌ ࢚ࣁ ࠙ࢳೞӝ

    CPU https://firebase.blog/posts/2018/11/ firebase-performance-monitoring
  9. Performance ݫݽܻо וܻѱ ૐоೞ׮о ׮਺ Trace ੹ ֎౟ਕ௼ ਃ୒ ੉

    ՘զ ٸ ૐоೞҊ ੓਺ Memory Trace ࣁ࣌ ࢚ࣁ ࠙ࢳೞӝ https://firebase.blog/posts/2018/11/ firebase-performance-monitoring
  10. Performance Memory Trace ࣁ࣌ ࢚ࣁ ࠙ࢳೞӝ ૐоೠ ݫݽܻ ࢎ੉ૉח ֎౟ਕ௼ܳ

    ా೧ оઉৡ ؘ੉ఠ 2MBী ೧׼ https://firebase.blog/posts/2018/11/ firebase-performance-monitoring
  11. Performance https://firebase.blog/posts/2018/11/ firebase-performance-monitoring Trace ࣁ࣌ ࢚ࣁ ࠙ࢳೞӝ ࠙ࢳ Ѿۿ ௾

    ੉޷૑ܳ ਃ୒ೡ ٸ ݫݽܻ৬ CPUী ৔ೱਸ ޷஖Ҋ ࢲ࠺झ੄ ੉޷૑ ۽٘ ࣘبо ו۰૑ח Ѿҗ
  12. Custom Trace ࢸ੿ೞӝ Performance // Import these Performance Monitoring classes

    at the top of your `.kt` file import com.google.firebase.perf.FirebasePerformance; import com.google.firebase.perf.metrics.Trace; val myTrace = Firebase.performance.newTrace("startup_trace") myTrace.start() // code that you want to trace myTrace.stop() https://firebase.google.com/docs/perf-mon/custom-code-traces?hl=ko&authuser=0&platform=android UX दաܻয়ী ٮۄ ழझథ ஏ੿ ೦ݾ ߂ ѱ੐ ۨ߰җ э਷ ࢎਊ੗ ࣘࢿ a tt ribute ୶о оמ
  13. Custom Trace ࢸ੿ೞӝ Performance https://firebase.google.com/docs/perf-mon/custom-code-traces?hl=ko&authuser=0&platform=android Firebase.performance.newTrace(“startup_trace”).trace { // Update scenario.

    putAttribute("cache", “true") // Reading scenario. val experimentValue = getAttribute("experiment") // Delete scenario. removeAttribute("experiment") // Read attributes. val traceAttributes = this.attributes } ࢎਊ੗ ࣘࢿ a tt ribute ୶о
  14. Custom Trace ࢸ੿ೞӝ Performance ѐੋ ध߹ ੿ࠁܳ ನೣೞח ࣘࢿਸ ୶оೞ૑

    ݃ࣁਃ ӝӝ ղ ࠺ਯ ઁೠ, ز੸ ࢠ೒݂, ࢲߡ ஏ ࠺ਯ ઁೠী ٮۄ ޖ੘ਤ۽ ࢠ೒݂ ػ чੑפ׮. ࢠ೒ ࣻо ৘࢚җ ׮ܲ ੉ਬח ޖ঺ੋоਃ?
  15. Feature Flagging জ ߓನ৬ Feature launch ܻ࠙ ࢜ ӝמ ੼૓੸

    ߓನ ౠ੿ ਬ੷ Ӓܛীѱ ݢ੷ ߓನ ޙઁ ߊࢤ द জ ੤ߓನ হ੉ ߄۽ ܀ߔ оמ
  16. Remote Config new_feature_enabled False 1% users && version >= 2.7.1

    True Key-value ह ࢤࢿ Server ӝࠄч In-App ӝࠄч False Override Key Conditional Values
  17. remoteConfig = Firebase.remoteConfig remoteConfig.addOnConfigUpdateListener(object : ConfigUpdateListener { override fun onUpdate(configUpdate:

    ConfigUpdate) { if (configUpdate.updatedKeys.contains("new_feature_enabled")) { remoteConfig.activate().addOnCompleteListener { updateNewFeature() } } } override fun onError(error: FirebaseRemoteConfigException) { . . . } })
  18. private fun updateNewFeature() { val newFeatureEnabled = remoteConfig[NEW_FEATURE_ENABLED].asBoolean() if (newFeatureEnabled)

    { // ࢜۽਍ Feature ௏٘ ୶о binding.fetchButton.setBackgroundColor(Color.RED) } else { // Feature ߓನ ੹ ௏٘ binding.fetchButton.setBackgroundColor(Color.BLUE) } } private const val NEW_FEATURE_ENABLED = "new_feature_enabled"