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. ౵੉য߬੉झ۽

    ࢲ࠺झ ಿ૕ ೠ ױ҅ ৢܻӝ
    ߓ೙઱,

    Android Engineer, NAVERZ

    GDG Android Korea

    View Slide

  2. উ٘۽੉٘ ѐߊ੗о ঌইঠ ೡ Ѫٜ

    View Slide

  3. View Slide

  4. Performance
    Remote Config
    A/B Testing
    Crashlytics

    View Slide

  5. Crashlytics
    ௼ېद ଺ӝ ௼ېद ࣻ੿
    Android Studio
    Memory bugs
    Stack traces ѐࢶ
    Crash grouping

    View Slide

  6. Crashlytics
    App Quality

    Insights
    Android Studio
    Click!

    View Slide

  7. Crashlytics App Quality Insights

    View Slide

  8. Crashlytics App Quality Insights
    ࢚ࣁ ੿ࠁ ഛੋ

    View Slide

  9. Crashlytics App Quality Insights
    Signals Filtering

    View Slide

  10. Crashlytics App Quality Insights
    Android Studio Hedgehog(Ҋढب஖)
    Play Store Vitals ݾ۾ب ഛੋ оמ

    View Slide

  11. GWP-ASan
    Crashlytics
    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

    View Slide

  12. GWP-ASan
    Crashlytics
    https://developer.android.com/ndk/guides/gwp-asan?hl=ko
    C++ Memory bugs

    View Slide

  13. GWP-ASan
    Crashlytics C++ Memory bugs

    View Slide

  14. Crashlytics Crash grouping
    ௏٘ ۄੋ੉ ׳ۄઉب э਷ ਗੋ੄ ௼ېद Ӓܛೝ
    ࢚ࣁ

    View Slide

  15. “জ੉ ו۰ਃ”

    View Slide

  16. “য٣о וܽ Ѧө?”
    “ޖ঺ࠗఠ ഛੋ೧ঠ ೞ૑?”

    View Slide

  17. Firebase Performance
    Monitoring
    ֎౟ਕ௼ ࣘب?
    জ द੘ दр?
    ౠ੿ Ҵо?
    ٣߄੉झ ࢎন?
    ӝӝ জ ߡ੹?

    View Slide

  18. Firebase Performance Monitoring
    জ द੘ दр ஏ੿
    HTTP ֎౟ਕ௼ ਃ୒ ੗ز ஏ੿
    Ҵо, ӝӝ জ ߡ੹ ١ ࣘࢿী
    ٮۄ ஏ੿ػ ࢿמ ࠙ܨ
    Custom Trace
    ࢿמ ঌܿ ࢸ੿

    View Slide

  19. पदр ࢿמ ݽפఠ݂
    Performance

    View Slide

  20. Performance
    ࢿמ ޙઁܳ ࡅܰѱ ଺Ҋ

    ೧Ѿ दр ױ୷ೞחؘ ب਑

    View Slide

  21. ੗ز ஏ੿ Trace
    4
    1
    ࢎਊ੗о

    জਸ ৈח द੼

    (௒٘ झఋ౟)
    ୐ߣ૩ Activity

    onResume()
    ݃૑݄ Activity

    onStop()
    Foreground Activity

    onResume()
    3
    2
    FirebasePerfProvider

    ContentProvider

    onCreate()
    Performance

    View Slide

  22. 4
    1
    ࢎਊ੗о

    জਸ ৈח द੼

    (௒٘ झఋ౟)
    ୐ߣ૩ Activity

    onResume()
    ݃૑݄ Activity

    onStop()
    Foreground Activity

    onResume()
    3
    2
    FirebasePerfProvider

    ContentProvider

    onCreate()
    _app_start
    _app_in_foreground
    _app_in_background
    Performance
    ੗ز ஏ੿ Trace

    View Slide

  23. জ द੘ दр ஏ੿җ ҙܻо ೙ਃೠ ੉ਬ?
    জী ؀ೠ ୐ ੋ࢚ਸ ઝ਋
    30 %
    2.4 %
    ࡈۄ૓

    জ द੘ दр
    Ѩ࢝ ૐо
    Source: goo.gle/3JCc453
    জ द੘ दр ஏ੿

    View Slide

  24. _app_start
    ࢎਊ੗о জਸ ৌযࢲ

    ୊਺ Activity
    onResume() ө૑
    Performance

    View Slide

  25. Performance Trace ࣘࢿ ؘ੉ఠ ೙ఠ݂
    ߔ࠙ਤ ࢸ੿
    7ੌр੄ ߸ചਯ

    View Slide

  26. Performance Trace ࣘࢿ ؘ੉ఠ ೙ఠ݂
    Click!

    View Slide

  27. Performance Trace ࣘࢿ ؘ੉ఠ ೙ఠ݂
    • জ ߡ੹

    • ੉੹ ߡ੹, ୭न ୹द ߡ੹җ ࠺Ү

    • ӝӝ ߹

    • ٣߄੉झ ߹ ࢎনী ٮۄ

    • Ҵо ߹

    • ؘ੉ఠ ߬੉झ ਤ஖о ౠ੿ ૑৉ী ৔ೱਸ
    ޷஖૑ח ঋח૑

    View Slide

  28. Performance Trace ࣘࢿ ؘ੉ఠ ࠺Ү

    View Slide

  29. Performance Trace ࣘࢿ ؘ੉ఠ ࠺Ү
    Click!

    View Slide

  30. Performance Trace ࣁ࣌ ࢚ࣁ ࠁӝ
    Click!

    View Slide

  31. Performance Trace ࣁ࣌ ࢚ࣁ ࠁӝ
    CPU, Memory,
    Trace ߂ Network
    Request
    https://firebase.blog/posts/2018/11/
    firebase-performance-monitoring

    View Slide

  32. Performance Trace ࣁ࣌ ࢚ࣁ ࠙ࢳೞӝ
    https://firebase.blog/posts/2018/11/firebase-performance-monitoring
    Trace ח 2.85ୡ Ѧܿ

    View Slide

  33. Performance
    https://firebase.blog/posts/2018/11/firebase-performance-monitoring
    On device
    Network
    ੉ Traceח ֎౟ਕ௼ ਃ୒җ
    زੌೞѱ प೯ؽ
    Trace ࣁ࣌ ࢚ࣁ ࠙ࢳೞӝ

    View Slide

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

    View Slide

  35. Performance
    ݫݽܻо וܻѱ ૐоೞ׮о
    ׮਺ Trace ੹ ֎౟ਕ௼ ਃ୒
    ੉ ՘զ ٸ ૐоೞҊ ੓਺
    Memory
    Trace ࣁ࣌ ࢚ࣁ ࠙ࢳೞӝ
    https://firebase.blog/posts/2018/11/
    firebase-performance-monitoring

    View Slide

  36. Performance
    Memory
    Trace ࣁ࣌ ࢚ࣁ ࠙ࢳೞӝ
    ૐоೠ ݫݽܻ ࢎ੉ૉח

    ֎౟ਕ௼ܳ ా೧ оઉৡ ؘ੉ఠ
    2MBী ೧׼
    https://firebase.blog/posts/2018/11/
    firebase-performance-monitoring

    View Slide

  37. Performance
    https://firebase.blog/posts/2018/11/
    firebase-performance-monitoring
    Trace ࣁ࣌ ࢚ࣁ ࠙ࢳೞӝ
    ࠙ࢳ Ѿۿ
    ௾ ੉޷૑ܳ ਃ୒ೡ ٸ ݫݽܻ৬ CPUী

    ৔ೱਸ ޷஖Ҋ ࢲ࠺झ੄ ੉޷૑ ۽٘ ࣘبо

    ו۰૑ח Ѿҗ

    View Slide

  38. 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 ୶о оמ

    View Slide

  39. 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 ୶о

    View Slide

  40. Custom Trace ࢸ੿ೞӝ Performance
    ୶оೠ ࣘࢿਵ۽ ؘ੉ఠ ೙ఠ݂ оמ

    View Slide

  41. Custom Trace ࢸ੿ೞӝ Performance
    ѐੋ ध߹ ੿ࠁܳ ನೣೞח ࣘࢿਸ ୶оೞ૑ ݃ࣁਃ
    ӝӝ ղ ࠺ਯ ઁೠ, ز੸ ࢠ೒݂, ࢲߡ ஏ ࠺ਯ ઁೠী
    ٮۄ ޖ੘ਤ۽ ࢠ೒݂ ػ чੑפ׮.
    ࢠ೒ ࣻо ৘࢚җ ׮ܲ ੉ਬח ޖ঺ੋоਃ?

    View Slide

  42. ࢿמਸ ѐࢶೞח ߑߨ
    https://developer.android.com/topic/performance/improving-overview?hl=ko

    View Slide

  43. ࢲ࠺झ ߓನܳ

    ೠ׮ח Ѫ..

    View Slide

  44. Feature Flagging
    জ ߓನ৬ Feature launch ܻ࠙
    ࢜ ӝמ ੼૓੸ ߓನ

    ౠ੿ ਬ੷ Ӓܛীѱ ݢ੷ ߓನ
    ޙઁ ߊࢤ द জ ੤ߓನ হ੉

    ߄۽ ܀ߔ оמ

    View Slide

  45. Remote Config
    new_feature_enabled
    False
    1% users

    && version >= 2.7.1
    True
    Key-value ह ࢤࢿ
    Server ӝࠄч
    In-App ӝࠄч False
    Override
    Key
    Conditional Values

    View Slide

  46. Remote Config
    Crashlytics
    Analytics
    पदр(real-time) সؘ੉౟ оמ

    View Slide

  47. Feature Flag ࢸ੿ೞӝ
    Click!

    View Slide

  48. Feature Flag ࢸ੿ೞӝ
    Feature launch ੹ূ

    ੋজ ӝࠄч ࢎਊ
    https://firebase.google.com/docs/remote-config/parameters?hl=ko
    Remote Config

    View Slide

  49. Feature Flag ࢸ੿ೞӝ
    ӝࠄ ч ࢸ੿
    https://firebase.google.com/docs/remote-config/parameters?hl=ko
    Remote Config
    Feature ߓನ ೡ ٸ

    ӝࠄ ч ߸҃ ߂

    ֢୹ ઑѤ ࢸ੿

    View Slide

  50. ੉ Feature Flag ܳ ࢎਊೡ
    ਬ੷ ઑѤ ૑੿

    View Slide

  51. 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) { . . . }
    })

    View Slide

  52. 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"

    View Slide

  53. Feature Flag ࢎਊೞӝ
    Remote Config
    ࢎਊ੗о জ সؘ੉౟ܳ
    ׮਍۽٘ೡ ೙ਃ হ੉

    জ੄ ز੘җ ݽনਸ ߸҃
    Summary

    View Slide

  54. A/B Testing
    জ ߸҃ࢎ೦ী ؀ೠ

    ࠺ૉפझ ૑಴ب ୓௼
    97%
    3%
    Winner!
    Button Test
    A B
    Remote Config

    View Slide

  55. A/B Test Report
    https://firebase.blog/posts/2023/04/maximize-
    revenue-with-remote-config-personalization
    Blog ࢎ۹ ੉޷૑

    View Slide

  56. A/B Testing
    https://firebase.google.com/
    docs/ab-testing/video-series?
    hl=ko
    A/B Test ߓ਋۞ оӝ

    View Slide

  57. Performance
    Remote Config
    A/B Testing
    Crashlytics
    https://github.com/firebase/quickstart-android
    Firebase Android Quick Start

    View Slide

  58. хࢎ೤פ׮!

    View Slide