컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
측정항목
애플리케이션의 다양한 런타임 측정항목 추적 및 보고
최근 업데이트 |
안정화 버전 |
출시 후보 버전 |
베타 버전 |
알파 버전 |
2025년 8월 27일 |
- |
- |
1.0.0-beta03 |
- |
종속 항목 선언
Metrics의 종속 항목을 추가하려면 프로젝트에 Google Maven 저장소를 추가해야 합니다. 자세한 내용은 Google Maven 저장소를 읽어보세요.
다음과 같이 앱 또는 모듈의 build.gradle
파일에 필요한 아티팩트의 종속 항목을 추가합니다.
Groovy
dependencies {
implementation "androidx.metrics:metrics-performance:1.0.0-beta03"
}
Kotlin
dependencies {
implementation("androidx.metrics:metrics-performance:1.0.0-beta03")
}
종속 항목에 관한 자세한 내용은 빌드 종속 항목 추가를 참고하세요.
의견
제출하신 의견은 Jetpack을 개선하는 데 도움이 됩니다. 새로운 문제를 발견하거나 라이브러리 개선을 위한 아이디어가 있다면 Google에 알려 주세요. 새 문제를 제출하기 전에 이 라이브러리의 기존 문제를 살펴보시기 바랍니다. 별표 버튼을 클릭하여 기존 문제에 투표할 수 있습니다.
새로운 문제 제출하기
자세한 내용은 Issue Tracker 문서를 참고하세요.
버전 1.0.0
버전 1.0.0-beta03
2025년 8월 27일
androidx.metrics:metrics-performance:1.0.0-beta03
이 출시되었습니다. 버전 1.0.0-beta03에는 이러한 커밋이 포함되어 있습니다.
버그 수정
IllegalArgumentException
('추가되지 않은 OnFrameMetricsAvailableListener
삭제 시도') 수정 창이 하드웨어 가속되지 않으면 프레임 타이밍을 기록하려고 시도하지 않습니다. 이는 Window.OnFrameMetricsAvailableListener
에서 지원되지 않기 때문입니다. (I8fef2, b/436880904)
버전 1.0.0-beta02
2025년 3월 12일
androidx.metrics:metrics-performance:1.0.0-beta02
이 출시되었습니다. 버전 1.0.0-beta02에는 이러한 커밋이 포함되어 있습니다.
버그 수정
버전 1.0.0-beta01
2024년 1월 10일
이 라이브러리의 API와 기능은 한동안 안정적이었습니다. 이 버전은 라이브러리를 베타로 푸시하기만 합니다.
androidx.metrics:metrics-performance:1.0.0-beta01
이 출시되었습니다. 버전 1.0.0-beta01에 포함된 커밋을 확인하세요.
버전 1.0.0-alpha04
2023년 4월 5일
이 출시에서는 JankStats가 최신 수정사항으로 업데이트되며 여기에는 더 정확하고 포괄적인 타이밍 정보가 포함됩니다.
androidx.metrics:metrics-performance:1.0.0-alpha04
이 출시되었습니다. 버전 1.0.0-alpha04에 포함된 커밋을 확인하세요.
API 변경사항
버전 1.0.0-alpha03
2022년 7월 27일
androidx.metrics:metrics-performance:1.0.0-alpha03
이 출시되었습니다. 버전 1.0.0-alpha03에 포함된 커밋을 확인하세요.
라이브러리가 베타 버전에 가까워짐에 따라 이 출시 버전에는 사소한 API 수정 사항이 포함되었습니다. API 변경사항 중 하나에서는 JankStats
객체를 만드는 createAndTrack()
팩토리 메서드에서 Executor가 삭제되었습니다. OnFrameListener
리스너는 이제 프레임당 데이터를 JankStats
에 전달하는 스레드(API 24 이전 버전에서는 기본/UI 스레드, API 24 및 이후 버전에서는 FrameMetrics
스레드)에서 호출되므로 이 호출에 영향을 줍니다. 또한 리스너에 전달된 FrameData
객체는 이제 모든 프레임에서 재사용되므로, 이 객체는 리스너가 반환되자마자 더 이상 사용되지 않는 것으로 간주되어야 하므로 콜백 중에 다른 곳에서 복사 및 캐시되어야 합니다.
동시 실행 문제를 포함한 몇 가지 버그도 수정되었습니다.
마지막으로, (위에서 언급한) FrameData
재사용 수정사항에 따라 이제 프레임 측정항목 전송으로 인해 프레임당 할당이 0이 됩니다. 이전에도 할당이 많이 않아지만, 새로운 접근 방식에서는 앱에서 프레임당 GC 오버헤드를 발생시키지 않고도 JankStats
를 사용할 수 있습니다.
API 변경사항
PerformanceMetricsState
의 메서드 및 매개변수 이름이 업데이트되어 이제 호출의 결과가 더 명확해졌습니다. (I56da5, b/233421985)
- 할당을 추적하기 위한 벤치마크 테스트가 추가되고, 상태 관리 및 보고와 관련된 몇 가지 내부 할당이 삭제되었습니다. 리스너에 전달되던
FrameData
는 이제 휘발성으로 간주됩니다. 이 구조는 다음번 프레임에서 재사용되며 리스너는 반환될 때까지만 믿을 수 있습니다.
JankStats
의 생성자에서 실행자가 삭제되었습니다. 이제 내부 데이터가 수신된 스레드에서 리스너가 호출됩니다. (I12743)
버그 수정
OnFrameMetricsAvailableListener
를 두 번 삭제하여 발생하는 비정상 종료 문제를 해결했습니다. (I44094, b/239457413)
- 보다 일관되고 예측 가능한 프레임 타이밍을 위해 큐 앞에
OnPreDrawListener
메시지를 게시하는 기존 로직으로 복귀했습니다. (I05a43, b/233358407)
- 리스너 대리자 목록이 프레임별 데이터 전송을 위해 반복되는 동안 동시에 수정되던
ConcurrentModificationException
버그가 수정되었습니다. (Ib7693, b/236612357)
버전 1.0.0-alpha02
2022년 6월 29일
androidx.metrics:metrics-performance:1.0.0-alpha02
가 출시되었습니다. 버전 1.0.0-alpha02에 포함된 커밋을 확인하세요.
API 변경사항
버그 수정
버전 1.0.0-alpha01
2022년 2월 9일
androidx.metrics:metrics-performance:1.0.0-alpha01
이 출시되었습니다. 버전 1.0.0-alpha01에 포함된 커밋을 확인하세요.
새로운 기능
JankStats
라이브러리가 실제 성능 문제를 찾는 데 도움이 되도록 런타임에 애플리케이션에서 콜백을 계측하고 수신하는 기능을 제공합니다.
JankStats
가 UI 상태 정보를 쉽게 삽입할 수 있는 API와 프레임별 성능 추적 및 보고 기능을 결합하여 개발자가 애플리케이션에 성능 문제가 있는지가 아니라 성능 문제가 언제, 왜 발생하는지를 이해할 수 있도록 합니다.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-08-27(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-27(UTC)"],[],[],null,["Metrics \nAPI Reference \n[androidx.metrics.performance](/reference/kotlin/androidx/metrics/performance/package-summary) \nTrack and report various runtime metrics for your application \n\n| Latest Update | Stable Release | Release Candidate | Beta Release | Alpha Release |\n|-----------------|----------------|-------------------|-----------------------------------------------------------------|---------------|\n| August 27, 2025 | - | - | [1.0.0-beta03](/jetpack/androidx/releases/metrics#1.0.0-beta03) | - |\n\nDeclaring dependencies\n\nTo add a dependency on Metrics, you must add the Google Maven repository to your\nproject. Read [Google's Maven repository](/studio/build/dependencies#google-maven)\nfor more information.\n\nAdd the dependencies for the artifacts you need in the `build.gradle` file for\nyour app or module: \n\nGroovy \n\n```groovy\ndependencies {\n implementation \"androidx.metrics:metrics-performance:1.0.0-beta03\"\n}\n```\n\nKotlin \n\n```kotlin\ndependencies {\n implementation(\"androidx.metrics:metrics-performance:1.0.0-beta03\")\n}\n```\n\nFor more information about dependencies, see [Add build dependencies](/studio/build/dependencies).\n\nFeedback\n\nYour feedback helps make Jetpack better. Let us know if you discover new issues or have\nideas for improving this library. Please take a look at the\n[existing issues](https://issuetracker.google.com/issues?q=componentid:1109743%20status:open)\nin this library before you create a new one. You can add your vote to an existing issue by\nclicking the star button.\n\n[Create a new issue](https://issuetracker.google.com/issues/new?component=1109743&template=1621342)\n\nSee the [Issue Tracker documentation](https://developers.google.com/issue-tracker)\nfor more information.\n\nVersion 1.0.0\n\nVersion 1.0.0-beta03\n\nAugust 27, 2025\n\n`androidx.metrics:metrics-performance:1.0.0-beta03` is released. Version 1.0.0-beta03 contains [these commits](https://android.googlesource.com/platform/frameworks/support/+log/7a145e052ae61e272e91ffe285e9451b8ab71870..cd8ce2bdb21194a81a76325a8e65dad5d7e28681/metrics/metrics-performance).\n\n**Bug Fixes**\n\n- Fix `IllegalArgumentException`(\"attempt to remove `OnFrameMetricsAvailableListener` that was never added\"). No attempt is made to record frame timing when a window isn't hardware accelerated, as this isn't supported by `Window.OnFrameMetricsAvailableListener`. ([I8fef2](https://android-review.googlesource.com/#/q/I8fef2d16449a9a50a2092200d28e45baae537e22), [b/436880904](https://issuetracker.google.com/issues/436880904))\n\nVersion 1.0.0-beta02\n\nMarch 12, 2025\n\n`androidx.metrics:metrics-performance:1.0.0-beta02` is released. Version 1.0.0-beta02 contains [these commits](https://android.googlesource.com/platform/frameworks/support/+log/7a45f0bc9e0a73744b3780a6f92e1b570de58bba..7a145e052ae61e272e91ffe285e9451b8ab71870/metrics/metrics-performance).\n\n**Bug Fixes**\n\n- Fix crashes `DelegatingFrameMetricsListener cannot be cast...` ([Id891c](https://android-review.googlesource.com/#/q/Id891c0cfdd7f45ef9e3b068644a113f39c8fc383), [b/311218678](https://issuetracker.google.com/issues/311218678)).\n\nVersion 1.0.0-beta01\n\nJanuary 10, 2024\n\nThe API and functionality of this library has been stable for some time. This release simply pushes the library to beta.\n\n`androidx.metrics:metrics-performance:1.0.0-beta01` is released. [Version 1.0.0-beta01 contains these commits.](https://android.googlesource.com/platform/frameworks/support/+log/a200cb82769634cecdb118ec4f0bfdf0b086e597..7a45f0bc9e0a73744b3780a6f92e1b570de58bba/metrics/metrics-performance)\n\nVersion 1.0.0-alpha04\n\nApril 5, 2023\n\nThis release updates JankStats to the latest fixes, which include more accurate and comprehensive timing information.\n\n`androidx.metrics:metrics-performance:1.0.0-alpha04` is released. [Version 1.0.0-alpha04 contains these commits.](https://android.googlesource.com/platform/frameworks/support/+log/a7f0710ad21f556f0dde9bf7bdab6d2135170fd4..a200cb82769634cecdb118ec4f0bfdf0b086e597/metrics/metrics-performance)\n\n**API Changes**\n\n- `cpuDuration` now more accurate, also new `totalDuration` on API31 ([I59ce8](https://android-review.googlesource.com/#/q/I59ce8c67f06a168f96893375c8aeca5516a55d81), [b/243694893](https://issuetracker.google.com/issues/243694893))\n\nVersion 1.0.0-alpha03\n\nJuly 27, 2022\n\n`androidx.metrics:metrics-performance:1.0.0-alpha03` is released. [Version 1.0.0-alpha03 contains these commits.](https://android.googlesource.com/platform/frameworks/support/+log/8094b683499b4098092c01028b55a38b49e357f2..a7f0710ad21f556f0dde9bf7bdab6d2135170fd4/metrics/metrics-performance)\n\n- This release contains minor API refinements as the library gets closer to beta. One of the API changes removes the Executor from the `createAndTrack()` factory method for creating a `JankStats` object. This has implications for the `OnFrameListener` callback, as that listener is now called on the thread which delivers the per-frame data to `JankStats` (the Main/UI thread on versions earlier than API 24, and the `FrameMetrics` thread on API 24+). Moreover, the `FrameData` object passed to the listener is now reused every frame, so data from that object must be copied and cached elsewhere during the callback, as that object should be considered obsolete as soon as the listener returns.\n\n- There were also various bug fixes, including some concurrency issues.\n\n- Finally, the fix to reuse `FrameData` (mentioned above) means that there are now zero allocations per frame due to frame metrics delivery. There weren't many allocations before, but the new approach means that you can use `JankStats` without incurring any per-frame GC overhead in your app.\n\n**API Changes**\n\n- Updated method and parameter names in `PerformanceMetricsState` to make the results of those calls clearer. ([I56da5](https://android-review.googlesource.com/#/q/I56da57b13818bf4077a64ab144222ce255f4539a), [b/233421985](https://issuetracker.google.com/issues/233421985))\n- Added benchmark tests to track allocations, eliminated some internal allocations related to state management and reporting. Note that `FrameData` passed to listeners is now considered volatile; that structure will be reused for the next frame and the data is only reliable until the listener returns.\n- Removed Executor from constructor for `JankStats`; listeners are now called on whatever thread the internal data was received upon. ([I12743](https://android-review.googlesource.com/#/q/I1274320bf29c171b82578868e657a3b01f7805c7))\n\n**Bug Fixes**\n\n- Fixed crash due to double-removal of `OnFrameMetricsAvailableListener` ([I44094](https://android-review.googlesource.com/#/q/I4409483d6e2f7287a0a93f521f68a4be9e22d969), [b/239457413](https://issuetracker.google.com/issues/239457413))\n- Return to original logic of posting `OnPreDrawListener` messages at front of queue, for more consistent and predictable frame timing. ([I05a43](https://android-review.googlesource.com/#/q/I05a434fe9453ea1be28d398e3eb284dd9b0cb64a), [b/233358407](https://issuetracker.google.com/issues/233358407))\n- Fixed `ConcurrentModificationException` bug where the list of listener delegates was being modified while it was also being iterated through to send per-frame data. ([Ib7693](https://android-review.googlesource.com/#/q/Ib769386f18e51dc6b58c935b42c5b8566c644abc), [b/236612357](https://issuetracker.google.com/issues/236612357))\n\nVersion 1.0.0-alpha02\n\nJune 29, 2022\n\n`androidx.metrics:metrics-performance:1.0.0-alpha02` is released. [Version 1.0.0-alpha02 contains these commits.](https://android.googlesource.com/platform/frameworks/support/+log/db2ecbef194afcddfaede22e1d884a8959a9277c..8094b683499b4098092c01028b55a38b49e357f2/metrics/metrics-performance)\n\n**API Changes**\n\n- Renamed `MetricsStateHolder` to just Holder (within `PerformanceMetricsState`): ([I5a4d9](https://android-review.googlesource.com/#/q/I5a4d9095520399a146e6fd78eb50c86a7051738b), [b/226565716](https://issuetracker.google.com/issues/226565716), [b/213499234](https://issuetracker.google.com/issues/213499234))\n\n**Bug Fixes**\n\n- Fixed timing issue where states could be replaced with new values before the frames had been processed where the old state would have been correct ([aosp/2061892](https://android-review.googlesource.com/c/platform/frameworks/support/+/2061892/), [b/213499234](https://issuetracker.google.com/issues/213499234))\n- Fixed concurrent modification exception in adding/removing listeners ([aosp/2092714](https://android-review.googlesource.com/c/platform/frameworks/support/+/2092714/), [b/213499234](https://issuetracker.google.com/issues/230388846))\n- Made startTime calculations more accurate ([aosp/2027704](https://android-review.googlesource.com/c/platform/frameworks/support/+/2027704/), [b/213245198](https://issuetracker.google.com/issues/213245198))\n- Fixed bug in `FrameData.equals()` implementation ([aosp/2025866](https://android-review.googlesource.com/c/platform/frameworks/support/+/2025866/), [b/218296544](https://issuetracker.google.com/issues/218296544))\n\nVersion 1.0.0-alpha01\n\nFebruary 9, 2022\n\n`androidx.metrics:metrics-performance:1.0.0-alpha01` is released. [Version 1.0.0-alpha01 contains these commits.](https://android.googlesource.com/platform/frameworks/support/+log/db2ecbef194afcddfaede22e1d884a8959a9277c/metrics/metrics-performance)\n\n**New Features**\n\n- The `JankStats` library provides functionality to instrument and receive callbacks in your application at runtime which can help find real world performance problems.\n- `JankStats` combines an API that makes it easy to inject information about UI state with capabilities for tracking and reporting per-frame performance to allow developers to understand not whether an application has performance issues, but when and why."]]