nm-perf-metrics
Version:
š Lightweight React Native module to collect app-level performance metrics in production (Android only).
46 lines (33 loc) ⢠685 B
Markdown
# nm-perf-metrics
š Lightweight React Native module to collect app-level performance metrics in production (Android only).
## Metrics
- ā
CPU Usage (%)
- ā
Memory Usage (MB and %)
- ā
Slow/Frozen Frames
- ā
FPS
## Installation
```sh
npm install nm-perf-metrics
cd android && ./gradlew clean && cd ..
npx react-native run-android
```
## Usage
```ts
import { getPerfStats } from 'nm-perf-metrics';
const stats = await getPerfStats();
console.log(stats);
```
## Example Output
```json
{
"memoryUsedMB": 142.3,
"memoryMaxMB": 256,
"memoryUsagePercent": 55.6,
"cpuUsagePercent": 22.1,
"slowFrames": 12,
"frozenFrames": 1,
"fps": 58
}
```
## License
MIT