Skip to content

fix: uptime as 0 if status is not online#103

Open
AlfieBrooks wants to merge 2 commits intosaikatharryc:masterfrom
AlfieBrooks:master
Open

fix: uptime as 0 if status is not online#103
AlfieBrooks wants to merge 2 commits intosaikatharryc:masterfrom
AlfieBrooks:master

Conversation

@AlfieBrooks
Copy link

Address #68

pm2_uptime isn't 0 if the service is down. This PR adds logic to only output the uptime if the service status is online, else return 0

@saikatharryc saikatharryc requested a review from Copilot August 3, 2025 19:37
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the pm2_uptime metric to correctly report 0 when a service is not online, addressing issue #68 where uptime was being calculated even for offline services.

  • Updates uptime calculation logic to conditionally return 0 for non-online services
  • Maintains existing uptime calculation for online services

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants