forked from runabol/tork
-
Notifications
You must be signed in to change notification settings - Fork 0
/
node.go
26 lines (21 loc) · 770 Bytes
/
node.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package tork
import "time"
var LAST_HEARTBEAT_TIMEOUT = time.Minute * 5
var HEARTBEAT_RATE = time.Second * 30
type NodeStatus string
const (
NodeStatusUP NodeStatus = "UP"
NodeStatusDown NodeStatus = "DOWN"
NodeStatusOffline NodeStatus = "OFFLINE"
)
type Node struct {
ID string `json:"id,omitempty"`
StartedAt time.Time `json:"startedAt,omitempty"`
CPUPercent float64 `json:"cpuPercent,omitempty"`
LastHeartbeatAt time.Time `json:"lastHeartbeatAt,omitempty"`
Queue string `json:"queue,omitempty"`
Status NodeStatus `json:"status,omitempty"`
Hostname string `json:"hostname,omitempty"`
TaskCount int `json:"taskCount"`
Version string `json:"version"`
}