$30 off During Our Annual Pro Sale. View Details »

E2Eテストから負荷試験シナリオを作ってみた / Why do we make a scenario of load testing from E2E testing scenarios

mackee
November 11, 2022

E2Eテストから負荷試験シナリオを作ってみた / Why do we make a scenario of load testing from E2E testing scenarios

PR TIMES x 面白法人カヤック合同勉強会

mackee

November 11, 2022
Tweet

More Decks by mackee

Other Decks in Programming

Transcript

  1. E2Eςετ͔Βෛՙࢼݧγφ ϦΦΛ࡞ͬͯΈͨ @mackee_w a.k.a macopy PR TIMES x ໘ന๏ਓΧϠοΫ߹ಉษڧձ 2022-11-11

    19:00
  2. @macopy • ໘ന๏ਓΧϠοΫ eεϙʔπࣄۀ෦ TonamelαʔόαΠυςοΫϦʔυ • Perlେ޷͖ Go΋޷͖ • ISUCON11

    ༏উ • ISUCON12 ༧બ ग़୊ • ࠷ۙϋϚ͍ͬͯΔϒΩ͸ιΠνϡʔόʔ
  3. Tonamelͷ࿩

  4. ߏ੒

  5. Client(Nuxt)͕GraphQLΛൃߦͯ͠

  6. ֤ϚΠΫϩαʔϏε͕GraphQLΛड͚Δ

  7. ൃ୺ ෛՙࢼݧΛ͍ͨ͠

  8. ͦͷଞ۩ମతͳ໨త

  9. ෛՙࢼݧΛ΍ΔͨΊʹ άοζΛ࡞ͬͯ΋Β͏

  10. εςʔδϯά؀ڥͷߏங

  11. ຊ൪DB͔Βͷίϐʔ https://techblog.kayac.com/automate-initializing-databases-for-staging

  12. k6ಋೖ

  13. thanks! @ebi-yade

  14. ͯ͞ɺͲ͏΍ͬͯγφϦΦΛॻ͜͏͔

  15. ՝୊: Tonamel͸SPA(ͳϖʔδ͕ଟ͍)

  16. ୯७ʹϖʔδΛfetch͢Δͱ NuxtͷΤϯτϦʔϙΠϯτͷHTML͕ ฦͬͯ͘Δ͚ͩ

  17. “ٖࣅతʹຊ൪ΞΫηεʹ͍ۙ"

  18. ஫ҙ: ࠷ॳ͔Β͜ΕΛ໨ࢦ͞ͳ͍Ͱʂ • ͜Ε is ʮٖࣅతʹຊ൪ΞΫηεʹ͍ۙʙʯ • ·ͣ͸ `/` ͱ͔ΛF5࿈ଧ͢ΔΑ͏ͳ୯७ͳγφϦΦΛ࡞Γ·͠ΐ͏

    • Ͱͳ͍ͱ͍ͭ·Ͱܦͬͯ΋ϕϯνϚʔΧʔࣗମͷڍಈ֬ೝ͕Ͱ͖ͳ͍ • ͜ͷ࣌఺Ͱ `/` ΍SPAͰ͸ͳ͍ϖʔδͷෛՙࢼݧ͸΍ͬͯΈ͍ͯΔ • ͦͯ͠”ऑ఺”͸ݟ͚͍ͭͯΔ…͕͜Ε͸·ͨผͷ࿩
  19. ࡞ઓ1: ۪௚ʹGraphQLΫΤϦΛॻ͍͍ͯ͘

  20. ײ૝: େม • ʮ͜Εɺ΋͔ͯ͠͠ΫϥΠΞϯτଆͷίʔυΛ࠶࣮૷ͯ͠ͳ͍ʁʁʯ • ΫΤϦ͸͋Δఔ౓ྲྀ༻ग़དྷΔ΋ͷͷ(k6΋JSͳͷͰ)ɺॲཧͱ͔͸ίϐ ϖ͕೉͍͠ͷͰΫϥΠΞϯτͷڍಈΛಡΈͳ͕Βॻ͍͍͔ͯ͘͠ແ͍ • ͋Δఔ౓ॲཧΛؙΊΔ(ఘΊΔʁ)ʹͯ͠΋ɺՃݮ͕೉͍͠

  21. ࡞ઓ2: xk6-browser https://k6.io/docs/javascript-api/xk6-browser/

  22. ʮϒϥ΢βΛ͍ͬͺ͍ฒ΂ͯΞΫηε ͠·͘Ε͹͍͍͡ΌΜʯ

  23. ݁Ռ: εέʔϧ͠ͳ͍, ҆ఆͤͣ • ͦ΋ͦ΋Chromium͔ͩΒͶ • xk6-browserͷ࢖͍ํ͕ѱ͍ͷ͔ɺ҆ఆ͍ͯ͠ͳ͍ͷ͔ɺΤϥʔ͕ग़ ·͘Δ

  24. ͸ʔͲ͏ͨ͠΋ͷ͔

  25. har-to-k6 https://github.com/grafana/har-to-k6

  26. ϒϥ΢βͷϩά͔Βk6ͷγφϦΦʹม׵͢Δ܅ • ൃ૝ʮϒϥ΢β͕ॏ͍ ͳΒϒϥ΢βͰϖʔδ ݟͨͱ͖ͷڍಈ͔Βγ φϦΦʹ͢Ε͹͍͍Μ ͡Όͳ͍ʁʯ • .HARϑΝΠϧ͔Βk6γ φϦΦ(JavaScript)΁ม

    ׵͢Δެࣜπʔϧ
  27. ͜ΕͰ΋՝୊ײ • ϑϩϯτΤϯυଆͷڍಈ͸೔ʑΊ·͙Δ͘͠มΘͬͯ͠·͏ • ෛՙࢼݧͱͯ͠͸ɺಛఆͷύε(=ػೳ)ʹΞΫηεͨ͠ͱ͖ͷϒϥ΢β͔Βͷ ϦΫΤετͷڍಈΛ࠶ݱ͍ͨ͠ • HARΛੜ੒͢ΔͨΊʹ࠷৽ͷϑϩϯτΤϯυͷڍಈΛ௥͔͚ͬΔͨΊʹ ChromeͰϙνϙν͢Δͷ͔ʁ •

    ਓྗͷਖ਼֬ੑɾਓྗͷखؒ => ໘౗͔͘͞͞Β͘Δෛՙࢼݧ཭Ε
  28. .HARΛ࡞Δͷ΋ࣗಈԽ͠·͠ΐ͏

  29. ࢓૊Έ

  30. PlaywrightͰHARΛు͘ίʔυ

  31. ݁Ռ: ͍͍ײ͡ͷෛՙΛ͔͚ΒΕͨ

  32. ׬

  33. ͦͷଞͷ࿩୊ • HARϕʔεγφϦΦͰଞͷυϝΠϯ΍ը૾ʹ͸fetch͠ͳ͍Α͏ʹ͢ΔϑΟϧλ • εςʔδϯά؀ڥ΁ͷೝূΛϕϯνϚʔΧʔ͚ͩճආ͢Δํ๏ • AuroraͷPerformance Insights͕ศར, ClusterͷҰ࣌ఀࢭ΋ศར •

    OGPͰmeta tagʹେձ৘ใΛຒΊࠐΜͰ͍Δ͕ͦΕ͕ॏͯ͘໘ന͍ʢ໘ന͘ͳ͍ʣ • SPA͔ͩΒΤϯτϦʔϙΠϯτ͚ͩݟͯ΋ҙຯ͕ͳ͍ͱ͸ͳΜͩͬͨͷ͔ • ΫΤϦΩϟογϡ͞Μɺࠓ·Ͱ͋Γ͕ͱ͏