Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(632)

Side by Side Diff: milo/api/resp/builder.go

Issue 2931773004: Milo: Add machine pool info for buildbot builder view. (Closed)
Patch Set: Rebase Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 //go:generate stringer -type=BotStatus
nodir 2017/06/13 02:38:40 why is it so far from the BotStatus definition? co
Ryan Tseng 2017/06/13 23:10:33 This is to get go generate to create botstatus_str
6
5 package resp 7 package resp
6 8
7 import "time" 9 import "time"
8 10
9 // Interval is a time interval which has a start, an end and a duration. 11 // Interval is a time interval which has a start, an end and a duration.
10 type Interval struct { 12 type Interval struct {
11 Started time.Time // when did this interval start 13 Started time.Time // when did this interval start
12 Finished time.Time // when did this interval finish 14 Finished time.Time // when did this interval finish
13 Duration time.Duration // length of the interval; may be non-zero if Fin ished is zero 15 Duration time.Duration // length of the interval; may be non-zero if Fin ished is zero
14 } 16 }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 // machines that can run in a builder. It has no meaning in buildbucket or dm 65 // machines that can run in a builder. It has no meaning in buildbucket or dm
64 // and is expected to be nil. 66 // and is expected to be nil.
65 MachinePool *MachinePool 67 MachinePool *MachinePool
66 68
67 // PrevCursor is a cursor to the previous page. 69 // PrevCursor is a cursor to the previous page.
68 PrevCursor string `json:",omitempty"` 70 PrevCursor string `json:",omitempty"`
69 // NextCursor is a cursor to the next page. 71 // NextCursor is a cursor to the next page.
70 NextCursor string `json:",omitempty"` 72 NextCursor string `json:",omitempty"`
71 } 73 }
72 74
75 type BotStatus int
76
77 const (
78 Unknown BotStatus = iota
nodir 2017/06/13 02:38:40 This is a package-global constant. Consider renami
Ryan Tseng 2017/06/13 23:10:33 Done. Going to keep the below 3 as is since it ma
79 Idle
80 Busy
81 Disconnected
82 )
83
84 // Bot represents a single bot.
85 type Bot struct {
86 Name *Link
87 Status BotStatus
88 }
89
73 // MachinePool represents the capacity and availability of a builder. 90 // MachinePool represents the capacity and availability of a builder.
74 type MachinePool struct { 91 type MachinePool struct {
75 » Connected int 92 » Total int
76 » Total int 93 » Disconnected int
77 » Free int 94 » Idle int
78 » Used int 95 » Busy int
96 » Bots []Bot
79 } 97 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698