Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add 'uptime ' to main view #135

Open
storytime opened this issue Jul 3, 2018 · 6 comments
Open

add 'uptime ' to main view #135

storytime opened this issue Jul 3, 2018 · 6 comments

Comments

@storytime
Copy link

No description provided.

@storytime storytime changed the title uptime add to main view add 'uptime ' to main view Jul 3, 2018
@sabrehagen
Copy link

One of the main metrics I use for judging a container is how long it has been running. This feature would be super useful to me if it's trivial to implement 🥇

@stokito
Copy link
Contributor

stokito commented Oct 26, 2020

There is a lot of info that may be retrieved from container but we should try to show only most important information. It's not so complicated to add a new column.
Why is uptime is so important? From docker inspect we can see more details:

 "State": {
            "Status": "exited",
            "Running": false,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 0,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2018-08-02T10:16:49.187187456Z",
            "FinishedAt": "2018-08-02T10:16:58.27795818Z"
        }

So to get uptime we need to count duration from StartedAt to FinishedAt. Maybe instead of uptime you just need this two columns?

stokito added a commit to stokito/ctop that referenced this issue Oct 26, 2020
@stokito
Copy link
Contributor

stokito commented Oct 26, 2020

I created a pull request but please note that it will show uptime on the moment of last refresh.
Please try to test my PR and leave your throughths and opinions.

@timwsuqld
Copy link

@stokito how often does that refresh happen? My uptime is stuck on the uptime when ctop was launched. CPU/Memory etc all refresh every second, uptime is stale

@stokito
Copy link
Contributor

stokito commented Nov 30, 2022

@timwsuqld as far I remember the uptime is just taken from docker ps output. E.g. it's not refreshed by the ctop. This makes it simple but yes, may be misleading if your top is open for long

@WeterPeter
Copy link

@timwsuqld as far I remember the uptime is just taken from docker ps output. E.g. it's not refreshed by the ctop. This makes it simple but yes, may be misleading if your top is open for long

True, this confused me. Can this be fixed by updating it regularly?

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

No branches or pull requests

5 participants