| OLD | NEW |
| 1 // Copyright 2016 The LUCI Authors. All rights reserved. | 1 // Copyright 2016 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 package buildbot | 5 package buildbot |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "fmt" | 8 "fmt" |
| 9 "strings" | 9 "strings" |
| 10 | 10 |
| 11 ds "github.com/luci/gae/service/datastore" | 11 ds "github.com/luci/gae/service/datastore" |
| 12 "github.com/luci/luci-go/common/clock" | 12 "github.com/luci/luci-go/common/clock" |
| 13 log "github.com/luci/luci-go/common/logging" | 13 log "github.com/luci/luci-go/common/logging" |
| 14 "github.com/luci/luci-go/common/sync/parallel" | 14 "github.com/luci/luci-go/common/sync/parallel" |
| 15 "github.com/luci/luci-go/milo/api/resp" | 15 "github.com/luci/luci-go/milo/api/resp" |
| 16 » "github.com/luci/luci-go/milo/appengine/common/model" | 16 » "github.com/luci/luci-go/milo/common/model" |
| 17 | 17 |
| 18 "golang.org/x/net/context" | 18 "golang.org/x/net/context" |
| 19 ) | 19 ) |
| 20 | 20 |
| 21 // getFullBuilds fetches all of the recent builds from the datastore. | 21 // getFullBuilds fetches all of the recent builds from the datastore. |
| 22 func getFullBuilds(c context.Context, masterName, builderName string, finished b
ool) ([]*buildbotBuild, error) { | 22 func getFullBuilds(c context.Context, masterName, builderName string, finished b
ool) ([]*buildbotBuild, error) { |
| 23 // TODO(hinoka): Builder specific structs. | 23 // TODO(hinoka): Builder specific structs. |
| 24 q := ds.NewQuery("buildbotBuild") | 24 q := ds.NewQuery("buildbotBuild") |
| 25 q = q.Eq("finished", finished) | 25 q = q.Eq("finished", finished) |
| 26 q = q.Eq("master", masterName) | 26 q = q.Eq("master", masterName) |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 } | 87 } |
| 88 log.Debugf(c, | 88 log.Debugf(c, |
| 89 "Builder %s took %s to query, %s to comp
ute.", builderName, | 89 "Builder %s took %s to query, %s to comp
ute.", builderName, |
| 90 t2.Sub(t1), clock.Since(c, t2)) | 90 t2.Sub(t1), clock.Since(c, t2)) |
| 91 return nil | 91 return nil |
| 92 } | 92 } |
| 93 } | 93 } |
| 94 }) | 94 }) |
| 95 return results, err | 95 return results, err |
| 96 } | 96 } |
| OLD | NEW |