pm2 api reports 0 for unstable_restarts

Created on 28 Oct 2017  路  1Comment  路  Source: Unitech/pm2

Your issue may already be reported!
Please search on the issue tracker before creating one.

What's going wrong?

I'm using https://github.com/politinn/pm2-prometheus-exporter to get basic stats about my running apps, however the unstable_restarts value is returning incorrectly. It seems this pulls from pm2_env.unstable_restarts on each response from running the list command

How could we reproduce this issue?

const pm2 = require('pm2');
pm2.list([], (err, resp) => {
   list.forEach(p => {
     console.log(p.pm2_env.unstable_restarts);
   })
});

Supporting information

Please run the following command (available on PM2 >= 2.6)

$ pm2 report

Most helpful comment

unstable_restarts is used as internal variable that doesn't count how much restart has been made, the one you are looking for is restart_time

>All comments

unstable_restarts is used as internal variable that doesn't count how much restart has been made, the one you are looking for is restart_time

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shaunwarman picture shaunwarman  路  3Comments

FujiHaruka picture FujiHaruka  路  3Comments

chaos-git picture chaos-git  路  3Comments

ghost picture ghost  路  3Comments

xzycn picture xzycn  路  3Comments