Giter VIP home page Giter VIP logo

Comments (5)

darxtrix avatar darxtrix commented on June 8, 2024

The following psutil methods can be used.

  1. .net_io_counters()
  2. .net_if_addrs()

from ptop.

smeet20 avatar smeet20 commented on June 8, 2024

Network Stats can be added using psutil.net_io_counters() by which we can display the bytes sent and received in the ptop monitor.

net = psutil.net_io_counters()
sentt = net[0]*0.000001
sentt = str(round(sentt,2))
recc = net[1]*0.000001
recc = str(round(recc,2))
row4 = "Network Usage:\nSent/Received {4}{0: <7}/{1: >7} MB{4}{2: >2} {5} {4}{3<8}".format(sentt,
recc,
'',
'',
" "int(4self.X_SCALING_FACTOR),
" "int(9self.X_SCALING_FACTOR))

from ptop.

darxtrix avatar darxtrix commented on June 8, 2024

Hi Smeet, Thanks for the code snippet. Actually, I have a plan to not show users raw stats in numbers but to have a bar graph also by using a module https://github.com/darxtrix/lehar that i wrote for this purpose.

from ptop.

smeet20 avatar smeet20 commented on June 8, 2024

from ptop.

darxtrix avatar darxtrix commented on June 8, 2024

@smeet20 Skipping the graph for now, fixed by #50

from ptop.

Related Issues (20)

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.