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

Unified Diff: ct/go/util/util.go

Issue 1392173005: [CT] Update worker scripts to use new benchmarks and delete old benchmarks (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: Cleanup capture_archives Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ct/go/util/constants.go ('k') | ct/go/worker_scripts/capture_archives/main.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ct/go/util/util.go
diff --git a/ct/go/util/util.go b/ct/go/util/util.go
index f126532cd9f9cfc8c4265e20e72c90c18c0dddc7..647deadccea15014856483c5508e9201a464f1ac 100644
--- a/ct/go/util/util.go
+++ b/ct/go/util/util.go
@@ -3,6 +3,7 @@ package util
import (
"bufio"
+ "encoding/json"
"fmt"
"io"
"io/ioutil"
@@ -237,3 +238,21 @@ func ChromeProcessesCleaner(locker sync.Locker, chromeCleanerTimer time.Duration
locker.Unlock()
}
}
+
+type PagesetVars struct {
dogben 2015/10/15 13:51:57 Nit: documentation.
rmistry 2015/10/15 14:21:56 Done.
+ UrlsList string `json:"urls_list"`
+ UserAgent string `json:"user_agent"`
+ ArchiveDataFile string `json:"archive_data_file"`
+}
+
+func ReadPageset(pagesetPath string) (PagesetVars, error) {
+ decodedPageset := PagesetVars{}
+ pagesetContent, err := os.Open(pagesetPath)
+ if err != nil {
+ return decodedPageset, fmt.Errorf("Could not read %s: %s", pagesetPath, err)
+ }
+ if err := json.NewDecoder(pagesetContent).Decode(&decodedPageset); err != nil {
+ return decodedPageset, fmt.Errorf("Could not JSON decode %s: %s", pagesetPath, err)
+ }
+ return decodedPageset, nil
+}
« no previous file with comments | « ct/go/util/constants.go ('k') | ct/go/worker_scripts/capture_archives/main.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698