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

Side by Side Diff: client/cmd/isolate/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 | « no previous file | client/cmd/isolate/build_chromium.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 "errors" 8 "errors"
9 "fmt" 9 "fmt"
10 "log" 10 "log"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 98
99 archiveDetails := &logpb.IsolateClientEvent_ArchiveDetails{ 99 archiveDetails := &logpb.IsolateClientEvent_ArchiveDetails{
100 HitCount: proto.Int64(int64(stats.TotalHits())), 100 HitCount: proto.Int64(int64(stats.TotalHits())),
101 MissCount: proto.Int64(int64(stats.TotalMisses())), 101 MissCount: proto.Int64(int64(stats.TotalMisses())),
102 HitBytes: proto.Int64(int64(stats.TotalBytesHits())), 102 HitBytes: proto.Int64(int64(stats.TotalBytesHits())),
103 MissBytes: proto.Int64(int64(stats.TotalBytesPushed())), 103 MissBytes: proto.Int64(int64(stats.TotalBytesPushed())),
104 } 104 }
105 if item.Error() != nil { 105 if item.Error() != nil {
106 archiveDetails.IsolateHash = []string{string(item.Digest())} 106 archiveDetails.IsolateHash = []string{string(item.Digest())}
107 } 107 }
108 » eventlogger := NewLogger(ctx, c.loggingFlags.EventlogEndpoint) 108 » eventlogger := NewLogger(ctx, eventlogEndpoint(ctx, c.loggingFlags.Event logEndpoint))
109 op := logpb.IsolateClientEvent_LEGACY_ARCHIVE.Enum() 109 op := logpb.IsolateClientEvent_LEGACY_ARCHIVE.Enum()
110 if err := eventlogger.logStats(ctx, op, start, end, archiveDetails); err != nil { 110 if err := eventlogger.logStats(ctx, op, start, end, archiveDetails); err != nil {
111 log.Printf("Failed to log to eventlog: %v", err) 111 log.Printf("Failed to log to eventlog: %v", err)
112 } 112 }
113 return err 113 return err
114 } 114 }
115 115
116 func (c *archiveRun) Run(a subcommands.Application, args []string, _ subcommands .Env) int { 116 func (c *archiveRun) Run(a subcommands.Application, args []string, _ subcommands .Env) int {
117 if err := c.Parse(a, args); err != nil { 117 if err := c.Parse(a, args); err != nil {
118 fmt.Fprintf(a.GetErr(), "%s: %s\n", a.GetName(), err) 118 fmt.Fprintf(a.GetErr(), "%s: %s\n", a.GetName(), err)
119 return 1 119 return 1
120 } 120 }
121 cl, err := c.defaultFlags.StartTracing() 121 cl, err := c.defaultFlags.StartTracing()
122 if err != nil { 122 if err != nil {
123 fmt.Fprintf(a.GetErr(), "%s: %s\n", a.GetName(), err) 123 fmt.Fprintf(a.GetErr(), "%s: %s\n", a.GetName(), err)
124 return 1 124 return 1
125 } 125 }
126 defer cl.Close() 126 defer cl.Close()
127 if err := c.main(a, args); err != nil { 127 if err := c.main(a, args); err != nil {
128 fmt.Fprintf(a.GetErr(), "%s: %s\n", a.GetName(), err) 128 fmt.Fprintf(a.GetErr(), "%s: %s\n", a.GetName(), err)
129 return 1 129 return 1
130 } 130 }
131 return 0 131 return 0
132 } 132 }
OLDNEW
« no previous file with comments | « no previous file | client/cmd/isolate/build_chromium.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698