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

Side by Side Diff: go/common/common.go

Issue 1307333002: Add alerting for CTFE V2. (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: Reformat Created 5 years, 3 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 | « ct/sys/ctfe.service ('k') | prober/go/prober/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 // Common tool initialization. 1 // Common tool initialization.
2 // import only from package main. 2 // import only from package main.
3 package common 3 package common
4 4
5 import ( 5 import (
6 "flag" 6 "flag"
7 "fmt" 7 "fmt"
8 "net" 8 "net"
9 "os" 9 "os"
10 "runtime" 10 "runtime"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 // Note(stephana): getGraphiteServer relies on Init() being called first . 50 // Note(stephana): getGraphiteServer relies on Init() being called first .
51 startMetrics(appName, getGraphiteServer()) 51 startMetrics(appName, getGraphiteServer())
52 } 52 }
53 53
54 // TODO(stephana): Refactor startMetrics to return an error instead of 54 // TODO(stephana): Refactor startMetrics to return an error instead of
55 // terminating the app. 55 // terminating the app.
56 56
57 func startMetrics(appName, graphiteServer string) { 57 func startMetrics(appName, graphiteServer string) {
58 if graphiteServer == "" { 58 if graphiteServer == "" {
59 » » glog.Warningf("No metrics server speicifed.") 59 » » glog.Warningf("No metrics server specified.")
rmistry 2015/08/26 20:53:26 Thank you. This bothered me this morning.
60 return 60 return
61 } 61 }
62 62
63 addr, err := net.ResolveTCPAddr("tcp", graphiteServer) 63 addr, err := net.ResolveTCPAddr("tcp", graphiteServer)
64 if err != nil { 64 if err != nil {
65 glog.Fatalf("Unable to resolve metrics server address: %s", err) 65 glog.Fatalf("Unable to resolve metrics server address: %s", err)
66 } 66 }
67 67
68 // Get the hostname and create the app-prefix. 68 // Get the hostname and create the app-prefix.
69 hostName, err := os.Hostname() 69 hostName, err := os.Hostname()
(...skipping 19 matching lines...) Expand all
89 } 89 }
90 90
91 func DecodeTomlFile(filename string, configuration interface{}) { 91 func DecodeTomlFile(filename string, configuration interface{}) {
92 if _, err := toml.DecodeFile(filename, configuration); err != nil { 92 if _, err := toml.DecodeFile(filename, configuration); err != nil {
93 glog.Fatalf("Failed to decode config file %s: %s", filename, err ) 93 glog.Fatalf("Failed to decode config file %s: %s", filename, err )
94 } 94 }
95 95
96 conf_str := spew.Sdump(configuration) 96 conf_str := spew.Sdump(configuration)
97 glog.Infof("Read TOML configuration from %s: %s", filename, conf_str) 97 glog.Infof("Read TOML configuration from %s: %s", filename, conf_str)
98 } 98 }
OLDNEW
« no previous file with comments | « ct/sys/ctfe.service ('k') | prober/go/prober/main.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698