Skip to content

Lu-C4/DataUsageMonitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A web-based application for analyzing network data usage statistics from Windows ESE databases. This tool reads data from the System Resource Usage Monitor (SRUDB) database and provides detailed visualizations and summaries of application network usage.

Features

  • Data Import: Load network statistics from Windows SRUDB.dat files
  • Date Range Filtering: Analyze data for custom time periods
  • Summary View: Display total and per-application data usage with unit conversion (bytes, KB, MB, GB)
  • Detailed Graphs: Visualize application-specific usage over time with interactive charts
  • Multiple Time Intervals: View data aggregated by daily, weekly, monthly, or yearly intervals
  • Dark Theme UI: Modern, responsive web interface with ApexCharts visualization

Installation

Prerequisites

  • Python 3.11+
  • Windows OS (for SRUDB.dat access)

Setup

  1. Clone or download the repository
  2. Install dependencies:
pip install -r requirements.txt
or
pip install pandas libesedb-python flask

Or using uv:

uv sync

Usage

  1. Start the Application:
python app.py

The application will be available at http://localhost:5000

  1. Prepare Data:

    • Copy SRUDB.dat from C:\Windows\System32\sru\SRUDB.dat to a safe location
    • ⚠️ Warning: Always work with a copy to avoid system interference

    alt text

  2. Analyze Data:

    • Enter the path to your SRUDB.dat copy
    • Select a start and end date
    • Click "SUBMIT" to view the summary
    • Click on any application card to see detailed usage graphs

    alt text

    alt text

Project Structure

DataUsageMonitor/
├── app.py                # Flask web application entry point
├── oper.py               # Core logic and data operations
├── pyproject.toml        # Project dependencies and metadata
├── requirements.txt      # Python package dependencies
├── templates/            # HTML templates
│   ├── index.html        # Main input form
│   ├── table.html        # Summary results view
│   └── graph.html        # Detailed usage graphs
├── static/               # Static assets
│   └── js/
│       └── apexcharts.js      # Chart initialization scripts
└── .gitignore            # Git ignore rules

Core Modules

oper.py

Contains all data processing functions:

  • string_to_ole_timestamp() - Converts HTML datetime input to OLE timestamp format
  • int_to_timestamp() - Converts OLE timestamps back to readable dates
  • blob_to_string() - Decodes binary blobs from database (UTF-16 LE/BE, Latin-1)
  • convert_table_to_data() - Extracts network statistics from ESE database
  • Sruconvert_table_to_data() - Extracts application ID mappings from database
  • summarize_app_usage_from_data() - Aggregates usage by application
  • genGraph() - Generates time-series data for charting
  • genpoints() - Creates timestamp intervals for data aggregation

app.py

Flask application with two main routes:

  • GET/POST / - Main form and summary table view
  • GET /details - Detailed per-application usage graphs

Technologies Used

License

ApexCharts code uses the MIT License (see templates/ApexCharts/license.txt)

Notes

  • OLE timestamp format represents dates as the number of days since December 30, 1899
  • The application requires read access to SRUDB.dat but does not modify it
  • Data is stored in memory during the session for quick access

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published