File: dstat_proc_count.py

package info (click to toggle)
dstat 0.7.4-6.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 1,608 kB
  • sloc: python: 5,964; makefile: 70; sh: 3
file content (15 lines) | stat: -rwxr-xr-x 373 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
### Author: Dag Wieers <dag@wieers.com>

class dstat_plugin(dstat):
    """
    Total Number of processes on this system.
    """
    def __init__(self):
        self.name = 'procs'
        self.vars = ('total',)
        self.type = 'd'
        self.width = 4
        self.scale = 10

    def extract(self):
        self.val['total'] = len([pid for pid in proc_pidlist()])