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

Side by Side Diff: client/cmd/isolate/exp_archive.go

Issue 2561543002: Log hit and miss file and byte counts from exparchive. (Closed)
Patch Set: Created 4 years 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 | « client/cmd/isolate/checker_test.go ('k') | no next file » | 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 package main 5 package main
6 6
7 import ( 7 import (
8 "context" 8 "context"
9 "encoding/json" 9 "encoding/json"
10 "errors" 10 "errors"
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 } 253 }
254 fmt.Printf("%s\t%s\n", isolItem.Digest, filepath.Base(archiveOpts.Isolat ed)) 254 fmt.Printf("%s\t%s\n", isolItem.Digest, filepath.Base(archiveOpts.Isolat ed))
255 255
256 end := time.Now() 256 end := time.Now()
257 257
258 if endpoint := eventlogEndpoint(c.isolateFlags.EventlogEndpoint); endpoi nt != "" { 258 if endpoint := eventlogEndpoint(c.isolateFlags.EventlogEndpoint); endpoi nt != "" {
259 logger := eventlog.NewClient(ctx, endpoint) 259 logger := eventlog.NewClient(ctx, endpoint)
260 260
261 // TODO(mcgreevy): fill out more stats in archiveDetails. 261 // TODO(mcgreevy): fill out more stats in archiveDetails.
262 archiveDetails := &logpb.IsolateClientEvent_ArchiveDetails{ 262 archiveDetails := &logpb.IsolateClientEvent_ArchiveDetails{
263 HitCount: proto.Int64(int64(checker.Hit.Count)),
264 MissCount: proto.Int64(int64(checker.Miss.Count)),
265 HitBytes: &checker.Hit.Bytes,
266 MissBytes: &checker.Miss.Bytes,
263 IsolateHash: []string{string(isolItem.Digest)}, 267 IsolateHash: []string{string(isolItem.Digest)},
264 } 268 }
265 if err := logStats(ctx, logger, start, end, archiveDetails); err != nil { 269 if err := logStats(ctx, logger, start, end, archiveDetails); err != nil {
266 log.Printf("Failed to log to eventlog: %v", err) 270 log.Printf("Failed to log to eventlog: %v", err)
267 } 271 }
268 } 272 }
269 273
270 return nil 274 return nil
271 } 275 }
272 276
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 func eventlogEndpoint(endpointFlag string) string { 336 func eventlogEndpoint(endpointFlag string) string {
333 switch endpointFlag { 337 switch endpointFlag {
334 case "test": 338 case "test":
335 return eventlog.TestEndpoint 339 return eventlog.TestEndpoint
336 case "prod": 340 case "prod":
337 return eventlog.ProdEndpoint 341 return eventlog.ProdEndpoint
338 default: 342 default:
339 return endpointFlag 343 return endpointFlag
340 } 344 }
341 } 345 }
OLDNEW
« no previous file with comments | « client/cmd/isolate/checker_test.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698