| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |