Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

fleetctl: Support service uptime as part of a list-units output #1293

Closed
wants to merge 1 commit into from

Conversation

wuqixuan
Copy link
Contributor

@wuqixuan wuqixuan commented Jul 6, 2015

We can get the uptime from systemctl, the resolve is like below:
localhost # /home/wood/fleet/fleetctl list-units
UNIT MACHINE ACTIVE SUB UPTIME
world.service 06ecd4f7.../192.168.122.30 active running 2015-07-06 07:38:38 AM, Since 11m39s
world2.service 1d3430ef.../192.168.122.31 active running 2015-07-06 07:48:24 AM, Since 1m54s
world_glob.service 06ecd4f7.../192.168.122.30 active running 2015-07-06 07:48:00 AM, Since 2m18s
world_glob.service 1d3430ef.../192.168.122.31 active running 2015-07-06 07:47:59 AM, Since 2m18s

Fixed #1128

We can get the uptime from systemctl, the resolve is like below:
localhost # /home/wood/fleet/fleetctl list-units
UNIT                    MACHINE                         ACTIVE  SUB     UPTIME
world.service           06ecd4f7.../192.168.122.30      active  running 2015-07-06 07:38:38 AM, Since 11m39s
world2.service          1d3430ef.../192.168.122.31      active  running 2015-07-06 07:48:24 AM, Since 1m54s
world_glob.service      06ecd4f7.../192.168.122.30      active  running 2015-07-06 07:48:00 AM, Since 2m18s
world_glob.service      1d3430ef.../192.168.122.31      active  running 2015-07-06 07:47:59 AM, Since 2m18s

Fixed coreos#1128
if us == nil || us.SystemdActiveState != "active" {
return "-"
}
tm := time.Unix(0, int64(us.SystemdActiveEnterTimestamp)*1000)
Copy link
Contributor

Choose a reason for hiding this comment

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

why this instead of time.Unix(int64(us.SystemdActiveEnterTimestamp), 0)?

@dongsupark dongsupark force-pushed the master branch 2 times, most recently from 14580b0 to 63b20dc Compare June 22, 2016 10:22
@dongsupark dongsupark force-pushed the master branch 3 times, most recently from 23d4b13 to 6fb1256 Compare July 1, 2016 11:07
@dongsupark dongsupark force-pushed the master branch 2 times, most recently from 54409ab to a1a21b8 Compare July 8, 2016 11:38
@dongsupark dongsupark force-pushed the master branch 3 times, most recently from 150d30c to 4002bf5 Compare August 16, 2016 08:54
@dongsupark dongsupark force-pushed the master branch 7 times, most recently from 3b60e93 to 875d938 Compare August 23, 2016 11:00
@dongsupark
Copy link
Contributor

Closed in favor of #1669

@dongsupark dongsupark closed this Aug 23, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Display service uptime as part of a list-units output
3 participants