Skip to content

Live uptime updates + inspect API cleanup (Docker connector)#8

Merged
LordOverlord merged 8 commits intomasterfrom
dev
Feb 28, 2026
Merged

Live uptime updates + inspect API cleanup (Docker connector)#8
LordOverlord merged 8 commits intomasterfrom
dev

Conversation

@LordOverlord
Copy link
Copy Markdown
Owner

@LordOverlord LordOverlord commented Feb 10, 2026

What

This PR improves container uptime handling and modernizes the Docker inspect call:

  • Adds a periodic uptime update loop (1s ticker) so uptime increments smoothly without relying on frequent Docker inspect.
  • Stores started_at / finished_at timestamps and uses them for live uptime rendering.
  • Adds validation/guardrails for bad timestamps and unreasonable uptime ranges; queues a refresh when data is invalid.
  • Replaces deprecated InspectContainer usage with InspectContainerWithOptions.
  • Initializes uptime meta for new containers and widens the UPTIME column to avoid truncation.

Includes the changes made by @ccarpinteri in this commit:
ccarpinteri@7249d4e#diff-75cd6cc14a79297338822dfe88e22101cfa75b46ec90d8b04d49237305c67ca4

Why:

  • Uptime was not updating smoothly (or could get stuck) unless a refresh happened.
  • Frequent inspect calls can be expensive and contribute to racey/laggy refresh behavior.
  • InspectContainer is deprecated in the Docker client used by this repo.
  • UI tweaks ensure uptime is visible and stable.

Notes

  • For stopped containers, uptime is displayed as -.
  • Refresh requests are queued non-blocking to avoid goroutine/channel stalls.

Testing

  • Ran ctop against a local Docker daemon with multiple running/stopped containers.
  • Verified uptime increments in real time and remains stable across refreshes.
  • Verified no regression in container listing/metadata display.

@LordOverlord LordOverlord self-assigned this Feb 10, 2026
@LordOverlord LordOverlord merged commit bc3870e into master Feb 28, 2026
3 checks passed
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.

1 participant