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

Side by Side Diff: appengine/cmd/milo/swarming/build.go

Issue 2069283002: milo: fix step duration (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: simplify step duration computation Created 4 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 Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package swarming 5 package swarming
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "encoding/json" 9 "encoding/json"
10 "fmt" 10 "fmt"
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 } 295 }
296 build.Summary.Duration = uint64(sr.Duration) 296 build.Summary.Duration = uint64(sr.Duration)
297 } 297 }
298 298
299 // Takes in an annotated log and returns a fully populated set of logdog streams 299 // Takes in an annotated log and returns a fully populated set of logdog streams
300 func streamsFromAnnotatedLog(ctx context.Context, log []byte) (*logdog.Streams, error) { 300 func streamsFromAnnotatedLog(ctx context.Context, log []byte) (*logdog.Streams, error) {
301 c := &memoryClient{} 301 c := &memoryClient{}
302 p := annotee.New(ctx, annotee.Options{ 302 p := annotee.New(ctx, annotee.Options{
303 Client: c, 303 Client: c,
304 MetadataUpdateInterval: -1, // Neverrrrrr send incr updates. 304 MetadataUpdateInterval: -1, // Neverrrrrr send incr updates.
305 Offline: true,
305 }) 306 })
306 defer p.Finish() 307 defer p.Finish()
307 308
308 is := annotee.Stream{ 309 is := annotee.Stream{
309 Reader: bytes.NewBuffer(log), 310 Reader: bytes.NewBuffer(log),
310 Name: types.StreamName("stdout"), 311 Name: types.StreamName("stdout"),
311 Annotate: true, 312 Annotate: true,
312 StripAnnotations: true, 313 StripAnnotations: true,
313 } 314 }
314 // If this ever has more than one stream then memoryClient needs to beco me 315 // If this ever has more than one stream then memoryClient needs to beco me
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 logdog.AddLogDogToBuild(c, URL, lds, build) 361 logdog.AddLogDogToBuild(c, URL, lds, build)
361 } 362 }
362 363
363 return build, nil 364 return build, nil
364 } 365 }
365 366
366 // taskPageURL returns a URL to a human-consumable page of a swarming task. 367 // taskPageURL returns a URL to a human-consumable page of a swarming task.
367 func taskPageURL(swarmingHostname, taskID string) string { 368 func taskPageURL(swarmingHostname, taskID string) string {
368 return fmt.Sprintf("https://%s/user/task/%s", swarmingHostname, taskID) 369 return fmt.Sprintf("https://%s/user/task/%s", swarmingHostname, taskID)
369 } 370 }
OLDNEW
« no previous file with comments | « appengine/cmd/milo/logdog/logDogBuild.go ('k') | appengine/cmd/milo/swarming/expectations/build-exception.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698