Atoptool / atop

System and process monitor for Linux
GNU General Public License v2.0
792 stars 109 forks source link

json: Print cgroups'a name when using -J and the label #285

Closed ton31337 closed 7 months ago

ton31337 commented 9 months ago

Before:

% atop -X -J PRG 1 | jq
{
      "pid": 514432,
      "name": "(php-fpm8.2)",
      "state": "E",
      "ruid": 69963,
      "rgid": 69963,
      "tgid": 514432,
      "nthr": 1,
      "st": "-E",
      "exitcode": 0,
      "btime": "1700730621",
      "cmdline": "(php-fpm: pool www                                          )",
      "ppid": 514430,
      "nthrrun": 0,
      "nthrslpi": 0,
      "nthrslpu": 0,
      "nthridle": 0,
      "euid": 0,
      "egid": 0,
      "elaps": "1299",
      "isproc": 1,
      "cid": "-"
    },

After:

    {
      "pid": 526057,
      "name": "(php-fpm8.2)",
      "state": "S",
      "ruid": 70019,
      "rgid": 70019,
      "tgid": 526057,
      "nthr": 1,
      "st": "-E",
      "exitcode": 0,
      "btime": "1700731393",
      "cmdline": "(php-fpm: master process (/etc/php-fpm/php-fpm.conf)        )",
      "ppid": 1,
      "nthrrun": 0,
      "nthrslpi": 1,
      "nthrslpu": 0,
      "nthridle": 0,
      "euid": 70019,
      "egid": 70019,
      "elaps": "0",
      "isproc": 1,
      "cid": "-",
      "cgroup": "/u000000096"
    },