soyuka / pidusage

Cross-platform process cpu % and memory usage of a PID
MIT License
512 stars 55 forks source link

feat: add command name #148 #149

Closed reply2future closed 1 year ago

reply2future commented 2 years ago
Q A
Branch? main
Bug fix? no
New feature? yes
Deprecations? no
Tickets Fix #148
License MIT
Doc PR api-platform/docs#...
  1. return object will contain command property like this:
    {
          command: '/Users/test/.nvm/versions/node/v16.13.0/bin/node',
          cpu: 0,
          ctime: 380,
          elapsed: 0,
          memory: 70254592,
          pid: 97953,
          ppid: 97942,
          timestamp: 1655970506696,
    }

    it already supports for ps,procfile and wmic.

  2. wmic changes output format to csv for extracting data more easily.
soyuka commented 1 year ago

I'm sorry I have to discard this feature. Indeed, this library takes a process id and sends back cpu and memory usage using system tools. I think that most of the time you have the Command yourself as you have the pid behind it. It is therefore quite not in sync with this project goal. Thanks anyway for the contribution!