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

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

Issue 2922153002: Log uses of isolate archive and exparchive when 'chromium' build tag is set.
Patch Set: use build tags to enable autologging 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 | « client/cmd/isolate/common.go ('k') | client/cmd/isolate/isolate_event_logger.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 package main 5 package main
6 6
7 import ( 7 import (
8 "encoding/json" 8 "encoding/json"
9 "errors" 9 "errors"
10 "fmt" 10 "fmt"
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 281
282 end := time.Now() 282 end := time.Now()
283 283
284 archiveDetails := &logpb.IsolateClientEvent_ArchiveDetails{ 284 archiveDetails := &logpb.IsolateClientEvent_ArchiveDetails{
285 HitCount: proto.Int64(int64(checker.Hit.Count)), 285 HitCount: proto.Int64(int64(checker.Hit.Count)),
286 MissCount: proto.Int64(int64(checker.Miss.Count)), 286 MissCount: proto.Int64(int64(checker.Miss.Count)),
287 HitBytes: &checker.Hit.Bytes, 287 HitBytes: &checker.Hit.Bytes,
288 MissBytes: &checker.Miss.Bytes, 288 MissBytes: &checker.Miss.Bytes,
289 IsolateHash: []string{string(isolItem.Digest)}, 289 IsolateHash: []string{string(isolItem.Digest)},
290 } 290 }
291 » eventlogger := NewLogger(ctx, c.loggingFlags.EventlogEndpoint) 291 » eventlogger := NewLogger(ctx, eventlogEndpoint(ctx, c.loggingFlags.Event logEndpoint))
292 op := logpb.IsolateClientEvent_ARCHIVE.Enum() 292 op := logpb.IsolateClientEvent_ARCHIVE.Enum()
293 if err := eventlogger.logStats(ctx, op, start, end, archiveDetails); err != nil { 293 if err := eventlogger.logStats(ctx, op, start, end, archiveDetails); err != nil {
294 log.Printf("Failed to log to eventlog: %v", err) 294 log.Printf("Failed to log to eventlog: %v", err)
295 } 295 }
296 296
297 return nil 297 return nil
298 } 298 }
299 299
300 func (c *expArchiveRun) parseFlags(args []string) error { 300 func (c *expArchiveRun) parseFlags(args []string) error {
301 if len(args) != 0 { 301 if len(args) != 0 {
(...skipping 30 matching lines...) Expand all
332 } 332 }
333 333
334 func hashFile(path string) (isolated.HexDigest, error) { 334 func hashFile(path string) (isolated.HexDigest, error) {
335 f, err := os.Open(path) 335 f, err := os.Open(path)
336 if err != nil { 336 if err != nil {
337 return "", err 337 return "", err
338 } 338 }
339 defer f.Close() 339 defer f.Close()
340 return isolated.Hash(f) 340 return isolated.Hash(f)
341 } 341 }
OLDNEW
« no previous file with comments | « client/cmd/isolate/common.go ('k') | client/cmd/isolate/isolate_event_logger.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698