Skip to content

Add Network Statistics Tracking to Logs Screen#15

Merged
Kin69 merged 5 commits intoKin69:mainfrom
Yashasewi:feature/logs-network-statistics
Aug 16, 2025
Merged

Add Network Statistics Tracking to Logs Screen#15
Kin69 merged 5 commits intoKin69:mainfrom
Yashasewi:feature/logs-network-statistics

Conversation

@Yashasewi
Copy link
Copy Markdown
Contributor

This pull request introduces a new network statistics summary feature to the logs screen, along with utility improvements and performance optimizations. The main changes include adding a UI section to display allowed, blocked, and total network requests, implementing supporting data models and utilities, and enhancing the LogsViewModel to efficiently compute and provide these statistics.

Key changes:

Feature: Network Statistics Summary

  • Added a new NetworkStatsSection composable and supporting UI code to display allowed, blocked, and total network request counts, along with session information, at the top of the logs screen (NetworkStatsSection.kt, LogsScreen.kt). [1] [2] [3] [4]

Data Model and State Management

  • Introduced the NetworkStatsState data class to represent network statistics, including counts and session state, in a structured way (NetworkStatsState.kt).
  • Updated LogsViewModel to provide a StateFlow of NetworkStatsState, track session start time, and expose this data for the UI.

Utilities and Performance

  • Added NumberFormatter utility for formatting large numbers into human-readable strings (e.g., 1.2K, 1.5M) for display in the UI (NumberFormatter.kt).
  • Introduced PerformanceMonitor utility to enable performance measurement and logging for statistics calculations and cache usage (PerformanceMonitor.kt).
  • Implemented caching and batching in LogsViewModel to optimize network statistics calculation and reduce unnecessary recomputation.

These changes collectively improve the user experience by providing clear, concise network activity summaries and ensure efficient, maintainable code for statistics tracking and display.

ImgBotApp and others added 5 commits August 15, 2025 07:02
*Total -- 123.50kb -> 82.73kb (33.01%)

/metadata/en-US/images/icon.png -- 34.11kb -> 20.11kb (41.06%)
/.github/play_store.png -- 63.19kb -> 40.47kb (35.95%)
/app/src/main/ic_launcher-playstore.png -- 22.69kb -> 19.08kb (15.92%)
/.github/github.png -- 3.51kb -> 3.08kb (12.37%)

Signed-off-by: ImgBotApp <[email protected]>
- Introduced `NumberFormatter` for formatting large counts into human-readable formats (e.g., 1K, 1.2M).
- Added `NetworkStatsState` data class to represent network request statistics including allowed, blocked, and total counts.
- Implemented `NetworkStatsSection` composable to display network statistics in the settings screen, utilizing the new formatting utility.
- Enhanced user experience by providing formatted descriptions for allowed and blocked requests, as well as total activity counts.
- Introduced `PerformanceMonitor` object to measure execution time, log memory usage, and track cache hit/miss statistics.
- Added inline function `measureTime` for timing code execution and logging results.
- Implemented `logMemoryUsage` and `logCacheStats` methods for detailed performance analysis in debug builds.
- Integrated `NetworkStatsSection` into `LogsScreen` to display network statistics.
- Updated `LogsViewModel` to manage network statistics, including caching and performance optimizations for log processing.
- Improved filtering and grouping of logs for better performance with large datasets.
- Added new string resources for network statistics descriptions.
@Kin69 Kin69 merged commit ce7ff26 into Kin69:main Aug 16, 2025
@Kin69
Copy link
Copy Markdown
Owner

Kin69 commented Aug 16, 2025

Thanks <3

@Yashasewi Yashasewi deleted the feature/logs-network-statistics branch August 18, 2025 06:23
@Yashasewi
Copy link
Copy Markdown
Contributor Author

welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants