| OLD | NEW |
| 1 /* | 1 /* |
| 2 Pulls data from multiple sources and funnels into InfluxDB. | 2 Pulls data from multiple sources and funnels into InfluxDB. |
| 3 */ | 3 */ |
| 4 | 4 |
| 5 package main | 5 package main |
| 6 | 6 |
| 7 import "flag" | 7 import "flag" |
| 8 | 8 |
| 9 import ( | 9 import ( |
| 10 "github.com/golang/glog" | 10 "github.com/golang/glog" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 ) | 32 ) |
| 33 | 33 |
| 34 func main() { | 34 func main() { |
| 35 common.InitWithMetrics("datahopper", *graphiteServer) | 35 common.InitWithMetrics("datahopper", *graphiteServer) |
| 36 | 36 |
| 37 // Prepare the InfluxDB credentials. Load from metadata if appropriate. | 37 // Prepare the InfluxDB credentials. Load from metadata if appropriate. |
| 38 if *useMetadata { | 38 if *useMetadata { |
| 39 *influxDbName = metadata.MustGet(INFLUXDB_NAME_METADATA_KEY) | 39 *influxDbName = metadata.MustGet(INFLUXDB_NAME_METADATA_KEY) |
| 40 *influxDbPassword = metadata.MustGet(INFLUXDB_PASSWORD_METADATA_
KEY) | 40 *influxDbPassword = metadata.MustGet(INFLUXDB_PASSWORD_METADATA_
KEY) |
| 41 } | 41 } |
| 42 » dbClient, err := influxdb.New(&influxdb.ClientConfig{*influxDbHost, *inf
luxDbName, *influxDbPassword, *influxDbDatabase, nil, false, false}) | 42 » dbClient, err := influxdb.New(&influxdb.ClientConfig{ |
| 43 » » Host: *influxDbHost, |
| 44 » » Username: *influxDbName, |
| 45 » » Password: *influxDbPassword, |
| 46 » » Database: *influxDbDatabase, |
| 47 » » HttpClient: nil, |
| 48 » » IsSecure: false, |
| 49 » » IsUDP: false, |
| 50 » }) |
| 43 if err != nil { | 51 if err != nil { |
| 44 glog.Fatalf("Failed to initialize InfluxDB client: %s", err) | 52 glog.Fatalf("Failed to initialize InfluxDB client: %s", err) |
| 45 } | 53 } |
| 46 | 54 |
| 47 // Data generation goroutines. | 55 // Data generation goroutines. |
| 48 go autoroll_ingest.LoadAutoRollData(dbClient, *workdir) | 56 go autoroll_ingest.LoadAutoRollData(dbClient, *workdir) |
| 49 go buildbot_ingest.LoadBuildbotDetailsData(dbClient) | 57 go buildbot_ingest.LoadBuildbotDetailsData(dbClient) |
| 50 go buildbot_ingest.LoadBuildbotByCommitData(dbClient, *workdir) | 58 go buildbot_ingest.LoadBuildbotByCommitData(dbClient, *workdir) |
| 51 | 59 |
| 52 // Wait while the above goroutines generate data. | 60 // Wait while the above goroutines generate data. |
| 53 select {} | 61 select {} |
| 54 } | 62 } |
| OLD | NEW |