Skip to content

docs: improve README.md formatting and structure #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 112 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,133 @@

# app_analysis

![Build](https://github.com/marchdev-tk/app_analysis/workflows/build/badge.svg)
[![Pub](https://img.shields.io/pub/v/app_analysis.svg)](https://pub.dartlang.org/packages/app_analysis)
![GitHub](https://img.shields.io/github/license/marchdev-tk/app_analysis)
![GitHub stars](https://img.shields.io/github/stars/marchdev-tk/app_analysis?style=social)

Package that provides an ability to track device stats, including CPU/RAM/Battery/Traffic.
A Flutter package to analyze your app's performance, resource usage, and gather runtime information like CPU temperature, memory usage, network traffic, and more.

## Getting Started

`ONLY ANDROID OS IS SUPPORTED!`

Add intro here

## Examples

Add examples here

---

## Features

- Start and stop app analysis easily.
- Monitor CPU information (temperature, frequency).
- Track memory usage.
- Collect and analyze HTTP traffic data.
- Retrieve comprehensive analysis data as JSON.

---

## Installation

Add this package to your `pubspec.yaml` file:

```yaml
dependencies:
app_analysis: ^latest_version
```

Then run:

```bash
flutter pub get
```

## Usage

Import the package:

```dart
import 'package:app_analysis/app_analysis.dart';
```

### Initialize and Start Analysis

```dart
final analyser = AppAnalyser();
analyser.initialise();

analyser.start();
```

### Stop Analysis and Get Results

```dart
final info = await analyser.stop();

print(info.toMap());
```

### Collecting HTTP Traffic Information

```dart
final request = await HttpClient().getUrl(Uri.parse('https://your-api.com'));
final response = await request.close();

AppAnalyser().collectTraffic(
HttpClientTrafficConsumptionAdapter(
HttpClientRequestResponse(request.toExtended(), response.toExtended()),
),
);
```

### Getting CPU Information

```dart
final cpuInfo = CpuInfoProvider();

print('Temperature: ${await cpuInfo.temperature}');
print('Average Temp: ${await cpuInfo.averageTemperature}');
print('Current Freq: ${await cpuInfo.currentFrequency}');
print('Extremum Freq: ${await cpuInfo.extremumFrequency}');
```

### Example Output of Analysis Data

```json
{
"cpu": {
"temperature": 45.5,
"averageTemperature": 43.2,
"currentFrequency": "2.4GHz",
"extremumFrequency": "1.2GHz - 2.8GHz"
},
"memory": {
"total": "4096MB",
"used": "1536MB",
"free": "2560MB"
},
"network": {
"trafficConsumption": [
{
"requestSize": "2KB",
"responseSize": "5KB"
}
]
}
}
```

## Example App

Check out the example directory for a complete implementation.

## Feature requests and Bug reports

Feel free to post a feature requests or report a bug [here](https://github.com/marchdev-tk/app_analysis/issues).

## TODO

* Add docs
* Migrate to platform agnostic file operations
* Remove external `battery_info` dependency in favour of custom data provider
* Add interesting data based on analysis results in `AnalysisInfo` model
- Add docs
- Migrate to platform agnostic file operations
- Remove external `battery_info` dependency in favour of custom data provider
- Add interesting data based on analysis results in `AnalysisInfo` model