Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
Adding back uptime to status.
Browse files Browse the repository at this point in the history
It will be deprecataed in a later version.
  • Loading branch information
morfien101 committed Mar 19, 2019
1 parent c7e6f5f commit 395df68
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions internalstate/progstatus.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ type AppStatusHandler struct {

// AppStatus - Holds status information about the chef waiter itself.
type AppStatus struct {
ServiceName string `json:"service_name"`
HostName string `json:"hostname"`
Uptime int64 `json:"start_time"`
Started string `json:"start_time_human_readable"`
ServiceName string `json:"service_name"`
HostName string `json:"hostname"`
StartTime int64 `json:"start_time"`
// Uptime is to be deprecated 19/03/2019
Uptime int64 `json:"uptime"`
StartTimeHuman string `json:"start_time_human_readable"`
Version string `json:"version"`
ChefVersion string `json:"chef_version"`
Healthy bool `json:"healthy"`
Expand Down Expand Up @@ -76,8 +78,10 @@ func (as *AppStatusHandler) setTime() {
as.Lock()
defer as.Unlock()
timeNow := time.Now()
// Uptime is to be deprecated 19/03/2019
as.state.Uptime = timeNow.Unix()
as.state.Started = timeNow.Format("Mon Jan 2 2006 - 15:04:05 -0700 MST")
as.state.StartTime = timeNow.Unix()
as.state.StartTimeHuman = timeNow.Format("Mon Jan 2 2006 - 15:04:05 -0700 MST")
}

// This is a looping function that will try to update chef waiter status with the version of chef.
Expand Down

0 comments on commit 395df68

Please sign in to comment.