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

Side by Side Diff: perf/go/ingest/main.go

Issue 813443002: Overhaul database package (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: Assume the MySQL password is "" when running locally Created 5 years, 11 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 | « perf/go/db/db_test.go ('k') | perf/go/perf_migratedb/main.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 package main 1 package main
2 2
3 // ingest is the command line tool for pulling performance data from Google 3 // ingest is the command line tool for pulling performance data from Google
4 // Storage and putting in Tiles. See the code in go/ingester for details on how 4 // Storage and putting in Tiles. See the code in go/ingester for details on how
5 // ingestion is done. 5 // ingestion is done.
6 6
7 import ( 7 import (
8 "flag" 8 "flag"
9 "net/http" 9 "net/http"
10 "strings" 10 "strings"
11 "time" 11 "time"
12 12
13 "github.com/golang/glog" 13 "github.com/golang/glog"
14 "skia.googlesource.com/buildbot.git/go/auth" 14 "skia.googlesource.com/buildbot.git/go/auth"
15 "skia.googlesource.com/buildbot.git/go/common" 15 "skia.googlesource.com/buildbot.git/go/common"
16 "skia.googlesource.com/buildbot.git/go/database"
16 "skia.googlesource.com/buildbot.git/go/gitinfo" 17 "skia.googlesource.com/buildbot.git/go/gitinfo"
17 "skia.googlesource.com/buildbot.git/perf/go/config" 18 "skia.googlesource.com/buildbot.git/perf/go/config"
18 "skia.googlesource.com/buildbot.git/perf/go/db" 19 "skia.googlesource.com/buildbot.git/perf/go/db"
19 "skia.googlesource.com/buildbot.git/perf/go/goldingester" 20 "skia.googlesource.com/buildbot.git/perf/go/goldingester"
20 "skia.googlesource.com/buildbot.git/perf/go/ingester" 21 "skia.googlesource.com/buildbot.git/perf/go/ingester"
21 "skia.googlesource.com/buildbot.git/perf/go/trybot" 22 "skia.googlesource.com/buildbot.git/perf/go/trybot"
22 ) 23 )
23 24
24 // flags 25 // flags
25 var ( 26 var (
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 go func() { 67 go func() {
67 oneStep() 68 oneStep()
68 for _ = range time.Tick(every) { 69 for _ = range time.Tick(every) {
69 oneStep() 70 oneStep()
70 } 71 }
71 }() 72 }()
72 } 73 }
73 } 74 }
74 75
75 func main() { 76 func main() {
77 // Setup DB flags.
78 database.SetupFlags(db.PROD_DB_HOST, db.PROD_DB_PORT, database.USER_RW, db.PROD_DB_NAME)
79
76 common.InitWithMetrics("ingest", *graphiteServer) 80 common.InitWithMetrics("ingest", *graphiteServer)
77 81
78 // Initialize the database. We might not need the oauth dialog if it fai ls. 82 // Initialize the database. We might not need the oauth dialog if it fai ls.
79 » db.Init(db.ProdDatabaseConfig(*local)) 83 » conf, err := database.ConfigFromFlagsAndMetadata(*local, db.MigrationSte ps())
84 » if err != nil {
85 » » glog.Fatal(err)
86 » }
87 » db.Init(conf)
80 88
81 var client *http.Client 89 var client *http.Client
82 var err error
83 if *doOauth { 90 if *doOauth {
84 config := auth.DefaultOAuthConfig(*oauthCacheFile) 91 config := auth.DefaultOAuthConfig(*oauthCacheFile)
85 client, err = auth.RunFlow(config) 92 client, err = auth.RunFlow(config)
86 if err != nil { 93 if err != nil {
87 glog.Fatalf("Failed to auth: %s", err) 94 glog.Fatalf("Failed to auth: %s", err)
88 } 95 }
89 } else { 96 } else {
90 client = nil 97 client = nil
91 // Add back service account access here when it's fixed. 98 // Add back service account access here when it's fixed.
92 } 99 }
(...skipping 19 matching lines...) Expand all
112 glog.Infof("Process name: %s", name) 119 glog.Infof("Process name: %s", name)
113 if startProcess, ok := ingesters[name]; ok { 120 if startProcess, ok := ingesters[name]; ok {
114 startProcess() 121 startProcess()
115 } else { 122 } else {
116 glog.Fatalf("Not a valid ingester name: %s", name) 123 glog.Fatalf("Not a valid ingester name: %s", name)
117 } 124 }
118 } 125 }
119 126
120 select {} 127 select {}
121 } 128 }
OLDNEW
« no previous file with comments | « perf/go/db/db_test.go ('k') | perf/go/perf_migratedb/main.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698