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

Unified Diff: client/cmd/isolate/checker.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | client/cmd/isolate/checker_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/cmd/isolate/checker.go
diff --git a/client/cmd/isolate/checker.go b/client/cmd/isolate/checker.go
index 79cb9733e7bbc79a93a88f8c5aa13650e7ca936a..5e2c159ac6bbd424e7ea6933db99ea2a9b602ea7 100644
--- a/client/cmd/isolate/checker.go
+++ b/client/cmd/isolate/checker.go
@@ -41,6 +41,19 @@ type Checker struct {
svc isolateService
bundler *bundler.Bundler
err error
+
+ Hit, Miss CountBytes
+}
+
+// CountBytes aggregates a count of files and the number of bytes in them.
+type CountBytes struct {
+ Count int
+ Bytes int64
+}
+
+func (cb *CountBytes) addFile(size int64) {
+ cb.Count++
+ cb.Bytes += size
}
// NewChecker creates a NewChecker with the given isolated client.
@@ -108,6 +121,12 @@ func (c *Checker) check(items []checkerItem) error {
return err
}
for i, item := range items {
+ if size := item.item.Size; out[i] == nil {
+ c.Hit.addFile(size)
+ } else {
+ c.Miss.addFile(size)
+ }
+
item.callback(item.item, out[i])
}
return nil
« no previous file with comments | « no previous file | client/cmd/isolate/checker_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698