Skip to content

Commit 1428bc7

Browse files
committed
docs: update documentation and add CHANGELOG
## Documentation Updates ### README.md - Update Kotlin version badge to 1.9.22 - Update Coroutines requirement to 1.8.0+ - Add JsonMetricsExporter to architecture diagram - Add JSON export example in Data Export section - Update feature description for export functionality ### CHANGELOG.md (new) - Create comprehensive changelog following Keep a Changelog format - Document all features in v1.0.0 release - Include unreleased changes section for recent refactoring - Add links for version comparison ### QUICK_START.md - Complete rewrite to use SysMetrics library API - Remove outdated manual file copying approach - Add proper initialization in Application class - Add overlay configuration examples - Add programmatic metrics access examples - Update troubleshooting section - Add integration checklist This improves developer experience with accurate, up-to-date documentation.
1 parent 2316843 commit 1428bc7

3 files changed

Lines changed: 249 additions & 309 deletions

File tree

CHANGELOG.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Added
11+
- Gradle Version Catalog (`libs.versions.toml`) for centralized dependency management
12+
- `HealthIssue.getRecommendations()` method for individual issue recommendations
13+
14+
### Changed
15+
- Centralized recommendation logic in `HealthIssue` enum (DRY principle)
16+
- Extracted magic numbers to named constants in `MetricsOverlayView`
17+
- Registered `JsonMetricsExporter` in `ExportManager` (was implemented but not registered)
18+
19+
### Fixed
20+
- JSON export format now available via `SysMetrics.exportMetrics(format = "json")`
21+
22+
## [1.0.0] - 2025-01-20
23+
24+
### Added
25+
- **Core Module (`sysmetrics-core`)**
26+
- `SysMetrics` singleton API for metrics collection
27+
- CPU metrics: usage percentage, core count, frequencies
28+
- Memory metrics: total, used, free, available, usage percentage
29+
- Battery metrics: level, temperature, status, health, plugged state
30+
- Thermal metrics: CPU temperature, battery temperature, throttling detection
31+
- Storage metrics: total, used, free storage capacity
32+
- Network metrics: RX/TX bytes, speeds, connection type, connectivity status
33+
- `Flow`-based reactive streams for real-time metrics observation
34+
- Health score calculation with weighted factors (CPU 30%, Memory 35%, Temperature 20%, Battery 15%)
35+
- Health issue detection and recommendation generation
36+
- Metrics history with configurable size (max 300 items)
37+
- Time-window aggregation (1min, 5min, 30min, 1hour)
38+
- CSV export (RFC 4180 compliant) with Excel compatibility
39+
- JSON export for API responses and log aggregation
40+
- TTL-based caching (500ms default)
41+
- Configurable logging (DEBUG, INFO, WARN, ERROR levels)
42+
- Thread-safe implementation with Mutex and Atomic types
43+
44+
- **Overlay Module (`sysmetrics-overlay`)**
45+
- In-app debug overlay (HUD) for real-time metrics visualization
46+
- FPS monitoring via Choreographer
47+
- Collapsed mode: FPS, CPU%, RAM%, Network speed
48+
- Expanded mode: Full metrics including battery, thermal, storage details
49+
- Draggable overlay positioning
50+
- Configurable colors, opacity, text size
51+
- Automatic lifecycle management
52+
- Release build safety (disabled by default in release)
53+
54+
- **Architecture**
55+
- Clean Architecture with Domain/Data/Infrastructure layers
56+
- Strategy Pattern for aggregation algorithms
57+
- Repository Pattern for data access
58+
- Dependency Injection ready design
59+
60+
- **Documentation**
61+
- Comprehensive README with Quick Start guide
62+
- Full API reference
63+
- Bilingual documentation (English/Russian)
64+
- Overlay usage guide
65+
- Architecture documentation
66+
67+
### Technical Details
68+
- Min SDK: 21 (Android 5.0)
69+
- Target SDK: 34 (Android 14)
70+
- Kotlin: 1.9.22
71+
- Coroutines: 1.8.0
72+
- Kotlinx Serialization: 1.6.2
73+
- Explicit API mode enabled
74+
75+
## [0.1.0] - 2025-01-15
76+
77+
### Added
78+
- Initial project structure
79+
- Basic CPU and memory metrics collection
80+
- Proof of concept implementation
81+
82+
---
83+
84+
[Unreleased]: https://github.com/yhtyyar/sysmetrics-android/compare/v1.0.0...HEAD
85+
[1.0.0]: https://github.com/yhtyyar/sysmetrics-android/compare/v0.1.0...v1.0.0
86+
[0.1.0]: https://github.com/yhtyyar/sysmetrics-android/releases/tag/v0.1.0

README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![License](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
44
[![API](https://img.shields.io/badge/API-21%2B-brightgreen.svg)](https://android-arsenal.com/api?level=21)
5-
[![Kotlin](https://img.shields.io/badge/Kotlin-1.9.10-blue.svg)](https://kotlinlang.org)
5+
[![Kotlin](https://img.shields.io/badge/Kotlin-1.9.22-blue.svg)](https://kotlinlang.org)
66

77
A production-ready Android library for collecting comprehensive system metrics including CPU, memory, battery, thermal, storage, and network information.
88

@@ -22,7 +22,7 @@ A production-ready Android library for collecting comprehensive system metrics i
2222
- 🔒 **Thread-safe** - Safe concurrent access
2323
-**High Performance** - <5ms latency, <5MB memory
2424
- 🎯 **Zero Dependencies** - Only Kotlin stdlib, Coroutines, Serialization
25-
- 📤 **Data Export** - CSV and JSON export functionality
25+
- 📤 **Data Export** - CSV and JSON export with streaming support
2626
- 🖥️ **Debug Overlay** - In-app HUD for real-time metrics visualization (optional module)
2727

2828
## Installation
@@ -254,6 +254,19 @@ val europeanConfig = CsvExportConfig(
254254
includeHeaders = true,
255255
lineEnding = "\r\n" // RFC 4180 compliant
256256
)
257+
258+
// Export to JSON format
259+
lifecycleScope.launch {
260+
val history = SysMetrics.getMetricsHistory(50).getOrNull() ?: emptyList()
261+
262+
SysMetrics.exportMetrics(
263+
metrics = history,
264+
format = "json" // JSON format
265+
).onSuccess { json ->
266+
// Use for API responses or log aggregation
267+
sendToAnalyticsServer(json)
268+
}
269+
}
257270
```
258271

259272
### Logging Configuration
@@ -338,7 +351,7 @@ sysmetrics-core/ # Core metrics library (no UI dependencies)
338351
├── data/
339352
│ ├── repository/ # MetricsRepositoryImpl
340353
│ ├── aggregation/ # MetricsAggregationStrategy
341-
│ ├── export/ # CsvMetricsExporter, ExportManager
354+
│ ├── export/ # CsvMetricsExporter, JsonMetricsExporter, ExportManager
342355
│ ├── mapper/ # Data transformers
343356
│ └── cache/ # MetricsCache (500ms TTL)
344357
├── infrastructure/
@@ -362,8 +375,8 @@ sysmetrics-overlay/ # Optional debug overlay module
362375

363376
- **Min SDK**: 21 (Android 5.0)
364377
- **Target SDK**: 34 (Android 14)
365-
- **Kotlin**: 1.9.10+
366-
- **Coroutines**: 1.7.3+
378+
- **Kotlin**: 1.9.22+
379+
- **Coroutines**: 1.8.0+
367380

368381
## License
369382

0 commit comments

Comments
 (0)