Comments (5)
The following psutil methods can be used.
.net_io_counters()
.net_if_addrs()
from ptop.
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.
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.
from ptop.
@smeet20 Skipping the graph for now, fixed by #50
from ptop.
Related Issues (20)
- Kill ptop properly HOT 4
- Killing chrome making ptop hung up
- The memory chart and process chart should be according to 100% in height HOT 1
- Feature Storming HOT 3
- New GUI can be drawn in terminal in case of terminal resizing HOT 2
- Optimize the sorting behavior
- Separate the keyboard shortcuts in some config file
- Killing a process making ptop exit abruptly HOT 3
- Python 3 compatability issue HOT 1
- Killing process when ptop starts HOT 1
- Restart process option not available as mentioned in #29.
- After killing terminal misbehaviour HOT 4
- Always an Update HOT 13
- Flickering, especially in byobu. HOT 1
- The Encoding Problem HOT 1
- Can't install ptop on CentOS 7 HOT 5
- Updater doesn't consistently work HOT 1
- ptop is the name of another program so won['t launch HOT 1
- No module named '_curses' HOT 2
- Proposing a PR to fix a few small typos
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ptop.