| OLD | NEW |
| 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 |
| 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 Loading... |
| 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 UnknownStatus BotStatus = iota |
| 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 } |
| OLD | NEW |