Robin Thellend | cafaa49 | 2014-06-24 13:58:25 -0700 | [diff] [blame] | 1 | // a simple command-line tool to run the benchmark server. |
| 2 | package main |
| 3 | |
| 4 | import ( |
Jiri Simsa | 519c507 | 2014-09-17 21:37:57 -0700 | [diff] [blame] | 5 | "veyron.io/veyron/veyron2/rt" |
| 6 | "veyron.io/veyron/veyron2/vlog" |
Robin Thellend | cafaa49 | 2014-06-24 13:58:25 -0700 | [diff] [blame] | 7 | |
Cosmos Nicolaou | d6c3c9c | 2014-09-30 15:42:53 -0700 | [diff] [blame] | 8 | "veyron.io/veyron/veyron/lib/signals" |
| 9 | "veyron.io/veyron/veyron/profiles/roaming" |
| 10 | "veyron.io/veyron/veyron/runtimes/google/ipc/benchmarks" |
Robin Thellend | cafaa49 | 2014-06-24 13:58:25 -0700 | [diff] [blame] | 11 | ) |
| 12 | |
| 13 | func main() { |
Matt Rosencrantz | 0610a23 | 2014-12-04 10:26:39 -0800 | [diff] [blame] | 14 | r, err := rt.New() |
| 15 | if err != nil { |
| 16 | vlog.Fatalf("Could not initialize runtime: %s", err) |
| 17 | } |
Matt Rosencrantz | c7fecf1 | 2014-11-27 19:58:43 -0800 | [diff] [blame] | 18 | defer r.Cleanup() |
| 19 | |
Cosmos Nicolaou | d6c3c9c | 2014-09-30 15:42:53 -0700 | [diff] [blame] | 20 | addr, stop := benchmarks.StartServer(r, roaming.ListenSpec) |
Robin Thellend | cafaa49 | 2014-06-24 13:58:25 -0700 | [diff] [blame] | 21 | vlog.Infof("Listening on %s", addr) |
| 22 | defer stop() |
Matt Rosencrantz | c7fecf1 | 2014-11-27 19:58:43 -0800 | [diff] [blame] | 23 | <-signals.ShutdownOnSignals(r) |
Robin Thellend | cafaa49 | 2014-06-24 13:58:25 -0700 | [diff] [blame] | 24 | } |