GithubHelp home page GithubHelp logo

udacity / cppnd-system-monitor-project-updated Goto Github PK

View Code? Open in Web Editor NEW
46.0 4.0 264.0 231 KB

System Monitor Project from the Object Oriented Programming Course of the Udacity C++ Nanodegree Program

License: MIT License

C++ 94.88% CMake 3.05% Makefile 2.08%

cppnd-system-monitor-project-updated's Introduction

CppND-System-Monitor

Starter code for System Monitor Project in the Object Oriented Programming Course of the Udacity C++ Nanodegree Program.

Follow along with the classroom lesson to complete the project!

System Monitor

Udacity Linux Workspace

Udacity provides a browser-based Linux Workspace for students.

You are welcome to develop this project on your local machine, and you are not required to use the Udacity Workspace. However, the Workspace provides a convenient and consistent Linux development environment we encourage you to try.

ncurses

ncurses is a library that facilitates text-based graphical output in the terminal. This project relies on ncurses for display output.

Within the Udacity Workspace, .student_bashrc automatically installs ncurses every time you launch the Workspace.

If you are not using the Workspace, install ncurses within your own Linux environment: sudo apt install libncurses5-dev libncursesw5-dev

Make

This project uses Make. The Makefile has four targets:

  • build compiles the source code and generates an executable
  • format applies ClangFormat to style the source code
  • debug compiles the source code and generates an executable, including debugging symbols
  • clean deletes the build/ directory, including all of the build artifacts

Instructions

  1. Clone the project repository: git clone https://github.com/udacity/CppND-System-Monitor-Project-Updated.git

  2. Build the project: make build

  3. Run the resulting executable: ./build/monitor Starting System Monitor

  4. Follow along with the lesson.

  5. Implement the System, Process, and Processor classes, as well as functions within the LinuxParser namespace.

  6. Submit!

cppnd-system-monitor-project-updated's People

Contributors

13rac1 avatar creich avatar delvingdeep avatar dsilver829 avatar gasparitiago avatar haoyang-udacity avatar ryan-keenan avatar sudkul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cppnd-system-monitor-project-updated's Issues

Missing option within CMake for find_package(Curses REQUIRED)

On some Linux systems an additional option must be set to get the given Code to link correctly.
Default repository clone ran me into the following error:

[100%] Linking CXX executable monitor
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: CMakeFiles/monitor.dir/src/ncurses_display.cpp.o: undefined reference to symbol 'cbreak'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib64/libtinfo.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

Checking the CMake documentation https://cmake.org/cmake/help/v3.13/module/FindCurses.html states: Set CURSES_NEED_NCURSES to TRUE before the find_package(Curses) call if NCurses functionality is required.
If i follow that, everything works as expected.

I'll provide a PR for that minor patch

ncurses_display processes list - out of range if process list is short

Ref

If the size of the processes list is less than n, the loop goes out of range and picks up some random gibberish.
I propose that the line be changed to check the list's size:

for (int i = 0; i < n && i < (int)processes.size(); ++i)

Similarly when the processes list shrinks the number of rows do not shrink accordingly. I propose something like that at the end of the function:

 // filling rows with white space after deleted processes
  for (int i = (int)processes.size(); i < n; ++i) {
    mvwprintw(window, ++row, pid_column,
              "                                                                                                 ");
  }

RAM calculation

Hello I am working on the project right now and I think the calculation of the RAM is not quite correct. Also on the example screenshot the Firefox process has 34390 MB = 34 GB alone.

LinuxParser.Kernel does not return correct string

Function needs to be updated so that it returns the proper value of the linux kernel defined in /proc/version. As it stands, right now the function returns the string "version" instead of string directly after version. All images used in the C++ course showing the htop display have the kernel field showing "version" instead of the proper value.

I'm more than happy to fix this, just give me a shout.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.