This project analyzes CPU scheduling algorithms and system errors by gathering real-time system metrics, training machine learning models, and visualizing performance through an interactive dashboard.
- System Monitoring: Collect CPU, memory, and disk usage metrics using
psutil. - Scheduling Analysis: Evaluate FCFS, SJF, Round Robin, and Priority Scheduling.
- Error Detection: Log system errors and deadlocks for better performance insights.
- Predictive Modeling: Train ML models to forecast CPU utilization and response time.
- Visualization: Display insights in an interactive dashboard using Dash and Plotly.
- Uses
psutilto collect system metrics. - Stores data in MySQL (
cpu_schedulingdatabase). - Implements CPU scheduling algorithms (FCFS, SJF, RR, Priority Scheduling).
- Logs system events and errors.
- Fetches data from MySQL (
performancetable). - Prepares dataset with CPU utilization, turnaround time, waiting time, response time.
- Trains Random Forest & Gradient Boosting Regressor models.
- Stores model evaluation metrics (MSE, R2, MAE) in MySQL (
model_evaluationtable).
- Fetches performance metrics from MySQL.
- Uses Dash & Plotly to create an interactive CPU Scheduling Performance Dashboard.
- Includes:
- CPU Utilization Over Time (Line Chart)
- Comparison of Scheduling Metrics (Bar Chart)
Run the following command to install all dependencies:
pip install psutil mysql-connector-python pandas numpy scikit-learn dash plotly matplotlib seaborn-
Collecting Data Directory main.py(System Monitoring & Data Collection)pip install psutil mysql-connector-python
-
Training and Evaluating the Data Directory main.py(Machine Learning Model Training)pip install pandas numpy scikit-learn mysql-connector-python
-
Visualizing the data Directory main.py(Dashboard & Visualization)pip install dash plotly pandas mysql-connector-python
- Python 3.8+
- MySQL Server
- Required Python libraries:
pip install psutil mysql-connector-python pandas numpy scikit-learn dash plotly
- Create the MySQL database:
CREATE DATABASE cpu_scheduling;
- Run
main.py, which creates tables and collects system metrics.
python main.py- Gathers system metrics and stores them in MySQL.
- Runs CPU scheduling algorithms and logs performance.
python main.py- Fetches data from MySQL and trains models.
- Stores model evaluation metrics.
python main.py- Launches the interactive dashboard on
http://127.0.0.1:8080/. - Select a scheduling algorithm to view insights.
-- **Before running each file check the file locations properly
✔ Real-time system monitoring and error logging.
✔ Performance evaluation of different CPU scheduling algorithms.
✔ Machine learning models for predicting CPU utilization trends.
✔ Interactive dashboard for visualizing scheduling performance.
- Integrate real-time alerts for system errors & deadlocks.
- Improve predictive models with deep learning.
- Enhance visualization with more analytics & user controls.
- Contributions are welcome! Feel free to open issues or submit pull requests to enhance the project.