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

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

Issue 2944633003: [milo] Add BuildSummary and common models. (Closed)
Patch Set: add comments 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
« no previous file with comments | « milo/api/resp/build.go ('k') | milo/api/resp/componenttype_string.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5 //go:generate stringer -type=BotStatus
6 6
7 package resp 7 package resp
8 8
9 import "time" 9 import (
10 » "time"
11
12 » "github.com/luci/luci-go/milo/appengine/common/model"
13 )
10 14
11 // Interval is a time interval which has a start, an end and a duration. 15 // Interval is a time interval which has a start, an end and a duration.
12 type Interval struct { 16 type Interval struct {
13 Started time.Time // when did this interval start 17 Started time.Time // when did this interval start
14 Finished time.Time // when did this interval finish 18 Finished time.Time // when did this interval finish
15 Duration time.Duration // length of the interval; may be non-zero if Fin ished is zero 19 Duration time.Duration // length of the interval; may be non-zero if Fin ished is zero
16 } 20 }
17 21
18 // BuildSummary is a summary of a build, with just enough information for displa y 22 // BuildSummary is a summary of a build, with just enough information for displa y
19 // on a builders page, with an optional field to return the whole build 23 // on a builders page, with an optional field to return the whole build
20 // information if available. 24 // information if available.
21 type BuildSummary struct { 25 type BuildSummary struct {
22 // Link to the build. 26 // Link to the build.
23 Link *Link 27 Link *Link
24 28
25 // Status of the build. 29 // Status of the build.
26 » Status Status 30 » Status model.Status
27 31
28 // Pending is time interval that this build was pending. 32 // Pending is time interval that this build was pending.
29 PendingTime Interval 33 PendingTime Interval
30 34
31 // Execution is time interval that this build was executing. 35 // Execution is time interval that this build was executing.
32 ExecutionTime Interval 36 ExecutionTime Interval
33 37
34 // Revision is the main revision of the build. 38 // Revision is the main revision of the build.
35 // TODO(hinoka): Maybe use a commit object instead? 39 // TODO(hinoka): Maybe use a commit object instead?
36 Revision string 40 Revision string
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 } 92 }
89 93
90 // MachinePool represents the capacity and availability of a builder. 94 // MachinePool represents the capacity and availability of a builder.
91 type MachinePool struct { 95 type MachinePool struct {
92 Total int 96 Total int
93 Disconnected int 97 Disconnected int
94 Idle int 98 Idle int
95 Busy int 99 Busy int
96 Bots []Bot 100 Bots []Bot
97 } 101 }
OLDNEW
« no previous file with comments | « milo/api/resp/build.go ('k') | milo/api/resp/componenttype_string.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698