From 7961599b2e41c71720a42b3bfde641f7529f05fe Mon Sep 17 00:00:00 2001 From: Corey Hulen Date: Tue, 22 Nov 2016 11:05:54 -0800 Subject: 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 --- vendor/github.com/tylerb/graceful/graceful.go | 7 ++----- vendor/github.com/tylerb/graceful/signal.go | 17 +++++++++++++++++ vendor/github.com/tylerb/graceful/signal_appengine.go | 13 +++++++++++++ 3 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 vendor/github.com/tylerb/graceful/signal.go create mode 100644 vendor/github.com/tylerb/graceful/signal_appengine.go (limited to 'vendor/github.com/tylerb') 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. +} -- cgit v1.2.3-1-g7c22