My solution for System Monitor Project in the Object Oriented Programming Course of the Udacity C++ Nanodegree Program.
System
Class: Represents the overall system and provides information about the system's state, such as the list of processes, memory utilization, and CPU utilization.Process
Class: Represents an individual process running on the system and provides information about that process, such as its ID, CPU usage, memory usage, and command.Processor
Class: Represents the CPU and provides information about its utilization.LinuxParser
Namespace: Contains functions that parse information from the Linux filesystem (primarily from the/proc
directory) to provide data needed by theSystem
,Process
, andProcessor
classes.
-
System
Class:- Uses functions from the
LinuxParser
namespace to gather system-wide information. - Maintains a list of
Process
objects, representing all running processes. - Contains a
Processor
object to represent the CPU.
- Uses functions from the
-
Process
Class:- Uses functions from the
LinuxParser
namespace to gather information specific to a process, such as its CPU and memory usage. - Each
Process
object corresponds to a single process on the system.
- Uses functions from the
-
Processor
Class:- Uses functions from the
LinuxParser
namespace to gather information about CPU utilization.
- Uses functions from the
This project uses Make. The Makefile has four targets:
build
compiles the source code and generates an executableformat
applies ClangFormat to style the source codedebug
compiles the source code and generates an executable, including debugging symbolsclean
deletes thebuild/
directory, including all of the build artifacts
-
Clone the project repository:
git clone <project_url>
-
Install ncurses within your own Linux environment:
sudo apt install libncurses5-dev libncursesw5-dev
. ncurses is a library that facilitates text-based graphical output in the terminal. This project relies on ncurses for display output. -
Build the project:
make build