Skip to content

KimotoYanke/tech-blog-webperf-observer

Repository files navigation

Webパフォーマンス定期観測

こちらは社内で使われている定期観測システムをやや簡易化させたものです

Architecture

web_performance_observation_architecture

Lighthouse以外のものを入れたり、Datadog以外へ入れたり、本番DBからランダムにページを抜き出して観測するということが将来的にありうるので、Clean Architectureで実装しています。

How to run locally

  1. まずDatadogでAPIキーとアプリケーションキーを取得します https://app.datadoghq.com/organization-settings/api-keys https://app.datadoghq.com/organization-settings/application-keys

  2. 続いて、URLをurl.jsonに登録します resources/url.json

  3. 以下のコマンドでmain.tsを起動します

DD_APP_KEY=[取得したアプリケーションキー] DD_API_KEY=[取得したAPIキー] npx ts-node main.ts

JSON内のページをLighthouseで測り、結果がDatadog側にenv:developmentで送信されます。

Metric名はwebperf.lighthouse.[ページのタグ].[desktop/mobile].[計測種別(largest_contentful_paintなど)]という形になります

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors