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

Side by Side Diff: experimental/webtry/webtry.go

Issue 338873003: Use DNS and not hard coded IP address of the monitoring server. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 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 | « no previous file | no next file » | 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 import ( 3 import (
4 "bytes" 4 "bytes"
5 "crypto/md5" 5 "crypto/md5"
6 "database/sql" 6 "database/sql"
7 "encoding/base64" 7 "encoding/base64"
8 "encoding/binary" 8 "encoding/binary"
9 "encoding/json" 9 "encoding/json"
10 "flag" 10 "flag"
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 } 283 }
284 } 284 }
285 }() 285 }()
286 286
287 metrics.RegisterRuntimeMemStats(metrics.DefaultRegistry) 287 metrics.RegisterRuntimeMemStats(metrics.DefaultRegistry)
288 go metrics.CaptureRuntimeMemStats(metrics.DefaultRegistry, 1*time.Minute ) 288 go metrics.CaptureRuntimeMemStats(metrics.DefaultRegistry, 1*time.Minute )
289 289
290 // Start reporting metrics. 290 // Start reporting metrics.
291 // TODO(jcgregorio) We need a centrialized config server for storing thi ngs 291 // TODO(jcgregorio) We need a centrialized config server for storing thi ngs
292 // like the IP address of the Graphite monitor. 292 // like the IP address of the Graphite monitor.
293 » addr, _ := net.ResolveTCPAddr("tcp", "10.240.159.195:2003") 293 » addr, _ := net.ResolveTCPAddr("tcp", "skia-monitoring-b:2003")
294 go metrics.Graphite(metrics.DefaultRegistry, 1*time.Minute, "webtry", ad dr) 294 go metrics.Graphite(metrics.DefaultRegistry, 1*time.Minute, "webtry", ad dr)
295 295
296 writeOutAllSourceImages() 296 writeOutAllSourceImages()
297 } 297 }
298 298
299 func writeOutAllSourceImages() { 299 func writeOutAllSourceImages() {
300 // Pull all the source images from the db and write them out to inout. 300 // Pull all the source images from the db and write them out to inout.
301 rows, err := db.Query("SELECT id, image, create_ts FROM source_images OR DER BY create_ts DESC") 301 rows, err := db.Query("SELECT id, image, create_ts FROM source_images OR DER BY create_ts DESC")
302 302
303 if err != nil { 303 if err != nil {
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 http.HandleFunc("/sources/", autogzip.HandleFunc(sourcesHandler)) 863 http.HandleFunc("/sources/", autogzip.HandleFunc(sourcesHandler))
864 864
865 // Resources are served directly 865 // Resources are served directly
866 // TODO add support for caching/etags/gzip 866 // TODO add support for caching/etags/gzip
867 http.Handle("/res/", autogzip.Handle(http.FileServer(http.Dir("./")))) 867 http.Handle("/res/", autogzip.Handle(http.FileServer(http.Dir("./"))))
868 868
869 // TODO Break out /c/ as it's own handler. 869 // TODO Break out /c/ as it's own handler.
870 http.HandleFunc("/", autogzip.HandleFunc(mainHandler)) 870 http.HandleFunc("/", autogzip.HandleFunc(mainHandler))
871 log.Fatal(http.ListenAndServe(*port, nil)) 871 log.Fatal(http.ListenAndServe(*port, nil))
872 } 872 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698