diff options
author | Corey Hulen <corey@hulen.com> | 2016-11-22 11:05:54 -0800 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2016-11-22 14:05:54 -0500 |
commit | 7961599b2e41c71720a42b3bfde641f7529f05fe (patch) | |
tree | 3c039e1d3790a954ba65fe551c7b348331bce994 /vendor/github.com/tylerb/graceful | |
parent | e033dcce8e57ed6b6684227adf9b29347e4718b3 (diff) | |
download | chat-7961599b2e41c71720a42b3bfde641f7529f05fe.tar.gz chat-7961599b2e41c71720a42b3bfde641f7529f05fe.tar.bz2 chat-7961599b2e41c71720a42b3bfde641f7529f05fe.zip |
PLT-4357 adding performance monitoring (#4622)
* WIP
* WIP
* Adding metrics collection
* updating vendor packages
* Adding metrics to config
* Adding admin console page for perf monitoring
* Updating glide
* switching to tylerb/graceful
Diffstat (limited to 'vendor/github.com/tylerb/graceful')
-rw-r--r-- | vendor/github.com/tylerb/graceful/graceful.go | 7 | ||||
-rw-r--r-- | vendor/github.com/tylerb/graceful/signal.go | 17 | ||||
-rw-r--r-- | vendor/github.com/tylerb/graceful/signal_appengine.go | 13 |
3 files changed, 32 insertions, 5 deletions
diff --git a/vendor/github.com/tylerb/graceful/graceful.go b/vendor/github.com/tylerb/graceful/graceful.go index a5e2395e0..07c990489 100644 --- a/vendor/github.com/tylerb/graceful/graceful.go +++ b/vendor/github.com/tylerb/graceful/graceful.go @@ -6,9 +6,7 @@ import ( "net" "net/http" "os" - "os/signal" "sync" - "syscall" "time" ) @@ -299,7 +297,7 @@ func (srv *Server) Serve(listener net.Listener) error { interrupt := srv.interruptChan() // Set up the interrupt handler if !srv.NoSignalHandling { - signal.Notify(interrupt, syscall.SIGINT, syscall.SIGTERM) + signalNotify(interrupt) } quitting := make(chan struct{}) go srv.handleInterrupt(interrupt, quitting, listener) @@ -336,8 +334,7 @@ func (srv *Server) Stop(timeout time.Duration) { defer srv.stopLock.Unlock() srv.Timeout = timeout - interrupt := srv.interruptChan() - interrupt <- syscall.SIGINT + sendSignalInt(srv.interruptChan()) } // StopChan gets the stop channel which will block until diff --git a/vendor/github.com/tylerb/graceful/signal.go b/vendor/github.com/tylerb/graceful/signal.go new file mode 100644 index 000000000..9550978fe --- /dev/null +++ b/vendor/github.com/tylerb/graceful/signal.go @@ -0,0 +1,17 @@ +//+build !appengine + +package graceful + +import ( + "os" + "os/signal" + "syscall" +) + +func signalNotify(interrupt chan<- os.Signal) { + signal.Notify(interrupt, syscall.SIGINT, syscall.SIGTERM) +} + +func sendSignalInt(interrupt chan<- os.Signal) { + interrupt <- syscall.SIGINT +} diff --git a/vendor/github.com/tylerb/graceful/signal_appengine.go b/vendor/github.com/tylerb/graceful/signal_appengine.go new file mode 100644 index 000000000..6b776f087 --- /dev/null +++ b/vendor/github.com/tylerb/graceful/signal_appengine.go @@ -0,0 +1,13 @@ +//+build appengine + +package graceful + +import "os" + +func signalNotify(interrupt chan<- os.Signal) { + // Does not notify in the case of AppEngine. +} + +func sendSignalInt(interrupt chan<- os.Signal) { + // Does not send in the case of AppEngine. +} |