संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
मेट्रिक
अपने ऐप्लिकेशन के लिए, रनटाइम की अलग-अलग मेट्रिक को ट्रैक और रिपोर्ट करें
नया अपडेट |
स्टेबल रिलीज़ |
रिलीज़ कैंडिडेट |
बीटा रिलीज़ |
ऐल्फ़ा रिलीज़ |
27 अगस्त, 2025 |
- |
- |
1.0.0-beta03 |
- |
डिपेंडेंसी का एलान करना
Metrics पर डिपेंडेंसी जोड़ने के लिए, आपको अपने प्रोजेक्ट में Google Maven रिपॉज़िटरी जोड़नी होगी. ज़्यादा जानकारी के लिए, Google का मेवन डेटाबेस पढ़ें.
अपने ऐप्लिकेशन या मॉड्यूल के लिए, build.gradle
फ़ाइल में उन आर्टफ़ैक्ट की डिपेंडेंसी जोड़ें जिनकी आपको ज़रूरत है:
ग्रूवी
dependencies {
implementation "androidx.metrics:metrics-performance:1.0.0-beta03"
}
Kotlin
dependencies {
implementation("androidx.metrics:metrics-performance:1.0.0-beta03")
}
डिपेंडेंसी के बारे में ज़्यादा जानने के लिए, बिल्ड डिपेंडेंसी जोड़ना लेख पढ़ें.
सुझाव/राय दें या शिकायत करें
आपके सुझाव, शिकायत या राय से Jetpack को बेहतर बनाने में मदद मिलती है. अगर आपको कोई नई समस्या मिलती है या इस लाइब्रेरी को बेहतर बनाने के लिए आपके पास कोई सुझाव है, तो हमें बताएं. कृपया नई लाइब्रेरी बनाने से पहले, इस लाइब्रेरी में मौजूद मौजूदा समस्याओं को देखें. स्टार बटन पर क्लिक करके, किसी मौजूदा समस्या के लिए वोट किया जा सकता है.
नई समस्या बनाना
ज़्यादा जानकारी के लिए, Issue Tracker का दस्तावेज़ देखें.
वर्शन 1.0.0
वर्शन 1.0.0-beta03
27 अगस्त, 2025
androidx.metrics:metrics-performance:1.0.0-beta03
रिलीज़ हो गया है. वर्शन 1.0.0-beta03 में ये कमिट शामिल हैं.
गड़बड़ियां ठीक की गईं
IllegalArgumentException
("ऐसी OnFrameMetricsAvailableListener
को हटाने की कोशिश की गई जिसे कभी जोड़ा ही नहीं गया") को ठीक करें. जब किसी विंडो में हार्डवेयर ऐक्सलरेशन की सुविधा काम नहीं करती है, तब फ़्रेम टाइमिंग को रिकॉर्ड करने की कोशिश नहीं की जाती. ऐसा इसलिए, क्योंकि यह सुविधा Window.OnFrameMetricsAvailableListener
के साथ काम नहीं करती. (I8fef2, b/436880904)
वर्शन 1.0.0-beta02
12 मार्च, 2025
androidx.metrics:metrics-performance:1.0.0-beta02
रिलीज़ हो गया है. वर्शन 1.0.0-beta02 में ये कमिट शामिल हैं.
गड़बड़ियां ठीक की गईं
- क्रैश की समस्या ठीक की गई
DelegatingFrameMetricsListener cannot be cast...
(Id891c, b/311218678).
वर्शन 1.0.0-beta01
10 जनवरी, 2024
इस लाइब्रेरी का एपीआई और इसकी सुविधाएं कुछ समय से स्थिर हैं. इस रिलीज़ में, लाइब्रेरी को बीटा वर्शन में पुश किया जाता है.
androidx.metrics:metrics-performance:1.0.0-beta01
रिलीज़ हो गया है. वर्शन 1.0.0-beta01 में ये कमिट शामिल हैं.
वर्शन 1.0.0-alpha04
5 अप्रैल, 2023
इस रिलीज़ में, JankStats को हाल ही में किए गए सुधारों के साथ अपडेट किया गया है. इनमें टाइमिंग की ज़्यादा सटीक और पूरी जानकारी शामिल है.
androidx.metrics:metrics-performance:1.0.0-alpha04
रिलीज़ हो गया है. वर्शन 1.0.0-alpha04 में ये कमिट शामिल हैं.
एपीआई में हुए बदलाव
cpuDuration
अब ज़्यादा सटीक है. साथ ही, API31 पर नया totalDuration
भी उपलब्ध है (I59ce8, b/243694893)
वर्शन 1.0.0-alpha03
27 जुलाई, 2022
androidx.metrics:metrics-performance:1.0.0-alpha03
रिलीज़ हो गया है. वर्शन 1.0.0-alpha03 में ये कमिट शामिल हैं.
इस रिलीज़ में, एपीआई में कुछ सुधार किए गए हैं, क्योंकि लाइब्रेरी बीटा वर्शन के करीब पहुंच गई है. एपीआई में हुए बदलावों में से एक बदलाव यह है कि createAndTrack()
ऑब्जेक्ट बनाने के लिए, createAndTrack()
फ़ैक्ट्री मेथड से Executor को हटा दिया गया है.JankStats
इसका असर OnFrameListener
कॉलबैक पर पड़ता है, क्योंकि अब उस लिसनर को उस थ्रेड पर कॉल किया जाता है जो JankStats
को हर फ़्रेम का डेटा डिलीवर करती है. यह थ्रेड, API 24 से पहले के वर्शन पर Main/UI थ्रेड होती है और API 24 या इसके बाद के वर्शन पर FrameMetrics
थ्रेड होती है. इसके अलावा, लिसनर को पास किया गया FrameData
ऑब्जेक्ट अब हर फ़्रेम के लिए फिर से इस्तेमाल किया जाता है. इसलिए, कॉलबैक के दौरान उस ऑब्जेक्ट से डेटा को कॉपी करके किसी दूसरी जगह पर कैश मेमोरी में सेव किया जाना चाहिए. ऐसा इसलिए, क्योंकि लिसनर के वापस आने के तुरंत बाद उस ऑब्जेक्ट को पुराना माना जाना चाहिए.
इसके अलावा, कई गड़बड़ियां भी ठीक की गई हैं. इनमें एक साथ कई अनुरोध मिलने से जुड़ी कुछ समस्याएं भी शामिल हैं.
आखिर में, FrameData
(ऊपर बताया गया) को फिर से इस्तेमाल करने की सुविधा का मतलब है कि फ़्रेम मेट्रिक की डिलीवरी की वजह से, अब हर फ़्रेम के लिए कोई भी आवंटन नहीं है. पहले, बहुत कम मेमोरी एलोकेट की जाती थी. हालांकि, नए तरीके से JankStats
का इस्तेमाल करने पर, आपके ऐप्लिकेशन में हर फ़्रेम के लिए, जीसी ओवरहेड नहीं लगेगा.
एपीआई में हुए बदलाव
PerformanceMetricsState
में अपडेट किए गए तरीके और पैरामीटर के नाम, ताकि उन कॉल के नतीजे ज़्यादा साफ़ तौर पर दिखें. (I56da5, b/233421985)
- बंटवारे को ट्रैक करने के लिए, बेंचमार्क टेस्ट जोड़े गए. साथ ही, राज्य के मैनेजमेंट और रिपोर्टिंग से जुड़े कुछ इंटरनल बंटवारे हटा दिए गए. ध्यान दें कि लिसनर को पास किया गया
FrameData
अब अस्थिर माना जाता है. इस स्ट्रक्चर का इस्तेमाल अगले फ़्रेम के लिए फिर से किया जाएगा. साथ ही, डेटा सिर्फ़ तब तक भरोसेमंद होता है, जब तक लिसनर वापस नहीं आ जाता.
JankStats
के कंस्ट्रक्टर से एक्ज़ीक्यूटर को हटा दिया गया है. अब लिसनर को उस थ्रेड पर कॉल किया जाता है जिस पर इंटरनल डेटा मिला था. (I12743)
गड़बड़ियां ठीक की गईं
OnFrameMetricsAvailableListener
को दो बार हटाने की वजह से होने वाले क्रैश की समस्या ठीक की गई (I44094, b/239457413)
- फ़्रेम टाइमिंग को ज़्यादा सटीक और अनुमानित बनाने के लिए,
OnPreDrawListener
मैसेज को कतार में सबसे आगे पोस्ट करने के ओरिजनल लॉजिक पर वापस जाएं. (I05a43, b/233358407)
ConcurrentModificationException
बग को ठीक किया गया. इस बग में, हर फ़्रेम का डेटा भेजने के लिए, लिसनर डेलिगेट की सूची में बदलाव किया जा रहा था. (Ib7693, b/236612357)
वर्शन 1.0.0-alpha02
29 जून, 2022
androidx.metrics:metrics-performance:1.0.0-alpha02
रिलीज़ हो गया है. वर्शन 1.0.0-alpha02 में ये कमिट शामिल हैं.
एपीआई में हुए बदलाव
गड़बड़ियां ठीक की गईं
- समय से जुड़ी समस्या को ठीक किया गया है. इसमें, फ़्रेम प्रोसेस होने से पहले ही राज्यों को नई वैल्यू से बदला जा सकता था. हालांकि, पुरानी वैल्यू सही होती (aosp/2061892, b/213499234)
- लिसनर जोड़ने/हटाने के दौरान, एक साथ कई बदलाव करने से जुड़ी समस्या को ठीक किया गया है (aosp/2092714, b/213499234)
- startTime के हिसाब से वीडियो शुरू होने के समय का हिसाब ज़्यादा सटीक तरीके से लगाया जा सकेगा (aosp/2027704, b/213245198)
FrameData.equals()
को लागू करने से जुड़ी गड़बड़ी ठीक की गई (aosp/2025866, b/218296544)
वर्शन 1.0.0-alpha01
9 फ़रवरी, 2022
androidx.metrics:metrics-performance:1.0.0-alpha01
रिलीज़ हो गया है. वर्शन 1.0.0-alpha01 में ये कमिट शामिल हैं.
नई सुविधाएं
JankStats
लाइब्रेरी, आपके ऐप्लिकेशन में रीयलटाइम में इंस्ट्रुमेंट करने और कॉलबैक पाने की सुविधा देती है. इससे परफ़ॉर्मेंस से जुड़ी असल समस्याओं का पता लगाने में मदद मिलती है.
JankStats
में एक ऐसा एपीआई शामिल है जो यूज़र इंटरफ़ेस (यूआई) की स्थिति के बारे में जानकारी को आसानी से इंजेक्ट करता है. साथ ही, इसमें हर फ़्रेम की परफ़ॉर्मेंस को ट्रैक करने और रिपोर्ट करने की सुविधाएं भी शामिल हैं. इससे डेवलपर को यह समझने में मदद मिलती है कि किसी ऐप्लिकेशन में परफ़ॉर्मेंस से जुड़ी समस्याएं हैं या नहीं. साथ ही, यह भी पता चलता है कि ये समस्याएं कब और क्यों हुईं.
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. Java और OpenJDK, 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."]]