Add Network Statistics Tracking to Logs Screen#15
Merged
Kin69 merged 5 commits intoKin69:mainfrom Aug 16, 2025
Merged
Conversation
*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.
Owner
|
Thanks <3 |
Contributor
Author
|
welcome |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
LogsViewModelto efficiently compute and provide these statistics.Key changes:
Feature: Network Statistics Summary
NetworkStatsSectioncomposable 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
NetworkStatsStatedata class to represent network statistics, including counts and session state, in a structured way (NetworkStatsState.kt).LogsViewModelto provide aStateFlowofNetworkStatsState, track session start time, and expose this data for the UI.Utilities and Performance
NumberFormatterutility for formatting large numbers into human-readable strings (e.g., 1.2K, 1.5M) for display in the UI (NumberFormatter.kt).PerformanceMonitorutility to enable performance measurement and logging for statistics calculations and cache usage (PerformanceMonitor.kt).LogsViewModelto 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.