# plugin_chrome_android_performance_monitor **Repository Path**: seph/plugin_chrome_android_performance_monitor ## Basic Information - **Project Name**: plugin_chrome_android_performance_monitor - **Description**: chrome 的插件,监测 android 的性能指标,支持可视化显示指标数据,记录导出数据,导入数据,AI 分析等功能 - **Primary Language**: TypeScript - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-12-31 - **Last Updated**: 2026-01-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Android Performance Monitor Real-time Android device performance monitoring Chrome extension with AI-powered analysis. ## Features - **Real-time Monitoring** - CPU, Memory, Network, and Battery metrics updated every 500ms - **Visual Charts** - Beautiful, responsive charts powered by Recharts - **AI Analysis** - Get intelligent performance insights using Claude API - **Data Export** - Export performance data to JSON or CSV - **Recording** - Record performance sessions for later analysis - **Multi-core CPU** - Track individual core usage and frequencies - **Network Stats** - Monitor upload/download speeds - **Battery Health** - Track battery level, temperature, and current ## Architecture - **Backend**: Node.js + Express + WebSocket (executes ADB commands) - **Frontend**: React + TypeScript + Vite (Chrome extension) - **Communication**: WebSocket for real-time data (500ms intervals) - **Charts**: Recharts (lightweight, React-native) - **State Management**: Redux Toolkit - **AI**: Claude API (Anthropic) - **Styling**: Tailwind CSS ## Prerequisites - **Node.js** 18+ ([Download](https://nodejs.org/)) - **ADB** (Android Debug Bridge) in PATH - macOS: `brew install android-platform-tools` - Linux: `sudo apt-get install adb` - Windows: [Download Platform Tools](https://developer.android.com/tools/releases/platform-tools) - **Android Device** with USB debugging enabled - **Claude API Key** (optional, for AI analysis) ## Quick Start ### 1. Installation ```bash # Clone or navigate to project directory cd performanceMonitor_claude # Run installation script bash scripts/install.sh ``` ### 2. Configuration Edit `backend/.env` and add your Claude API key (optional): ```env CLAUDE_API_KEY=your_api_key_here ``` ### 3. Start Development ```bash # Start both backend and extension dev servers bash scripts/dev.sh ``` ### 4. Load Extension in Chrome 1. Open `chrome://extensions/` 2. Enable "Developer mode" 3. Click "Load unpacked" 4. Select the `extension/dist` folder ### 5. Connect Android Device 1. Enable USB debugging on your Android device 2. Connect device via USB 3. Run `adb devices` to verify connection 4. Open the Chrome extension ## Project Structure ``` performanceMonitor_claude/ ├── backend/ # Node.js backend │ ├── src/ │ │ ├── adb/ # ADB management and parsing │ │ ├── services/ # Monitoring services │ │ ├── websocket/ # WebSocket server │ │ ├── api/ # REST API and Claude service │ │ └── server.ts # Main server │ └── package.json ├── extension/ # Chrome extension │ ├── src/ │ │ ├── components/ # React components │ │ ├── hooks/ # Custom hooks │ │ ├── store/ # Redux store │ │ └── App.tsx │ └── package.json ├── scripts/ # Build and deployment scripts └── docs/ # Documentation ``` ## Usage ### Recording Performance Data 1. Click "Start Recording" in the Connection Panel 2. Perform actions on your Android device 3. Click "Stop Recording" when done 4. Use "Export JSON" or "Export CSV" to save data ### AI Analysis 1. Record some performance data first 2. Click "Analyze with AI" button 3. Wait for Claude to analyze the data 4. Review insights and recommendations ### Monitoring Metrics - **CPU**: Overall and per-core usage, frequencies, temperature - **Memory**: Total, used, available, percentage - **Network**: Upload/download speeds, total data - **Battery**: Level, status, temperature, voltage, current ## Building for Production ### Build Backend ```bash bash scripts/build-backend.sh ``` ### Build Extension ```bash bash scripts/build-extension.sh ``` ### Package for Chrome Web Store ```bash bash scripts/package-extension.sh ``` This creates a ZIP file ready for Chrome Web Store upload. ## Chrome Web Store Publishing See [docs/CHROME_STORE.md](docs/CHROME_STORE.md) for detailed publishing instructions. ## Development ### Backend Development ```bash cd backend npm run dev ``` ### Extension Development ```bash cd extension npm run dev ``` ### Type Checking ```bash # Backend cd backend npx tsc --noEmit # Extension cd extension npm run type-check ``` ## Troubleshooting ### No devices found - Ensure USB debugging is enabled on Android device - Check USB connection - Run `adb devices` to verify device is detected - Try `adb kill-server && adb start-server` ### Connection failed - Ensure backend is running on port 3001 - Check firewall settings - Verify WebSocket connection: `ws://localhost:3001` ### AI analysis not working - Verify Claude API key in `backend/.env` - Check API key has sufficient credits - Review backend console for error messages ### Extension not loading - Ensure extension is built: `bash scripts/build-extension.sh` - Check Chrome developer console for errors - Try reloading the extension ## Performance Tips - Monitor at 500ms intervals for smooth real-time updates - Recording stores data in memory - clear recordings periodically - Export data regularly to avoid memory issues - CPU usage is calculated using delta method for accuracy ## API Endpoints - `GET /` - Server info - `GET /api/health` - Health check - `POST /api/analyze` - AI analysis - `POST /api/export` - Data export - `ws://localhost:3001` - WebSocket connection ## License MIT ## Contributing Contributions are welcome! Please read the contributing guidelines first. ## Support For issues and questions: - Check [docs/INSTALLATION.md](docs/INSTALLATION.md) for setup help - Review [docs/CHROME_STORE.md](docs/CHROME_STORE.md) for publishing - Open an issue on GitHub ## Credits - Built with [React](https://react.dev/) - Charts by [Recharts](https://recharts.org/) - AI by [Anthropic Claude](https://www.anthropic.com/) - Icons from [Heroicons](https://heroicons.com/) --- **Version**: 1.0.0 **Author**: Your Name **Last Updated**: 2025-12-29