include pid in sleep response

This commit is contained in:
Naitik Shah 2013-03-25 14:54:13 -07:00
parent 308a01b46b
commit 07af98f40b

View File

@ -7,6 +7,7 @@ import (
"fmt" "fmt"
"github.com/daaku/go.grace/gracehttp" "github.com/daaku/go.grace/gracehttp"
"net/http" "net/http"
"os"
"time" "time"
) )
@ -36,10 +37,11 @@ func newHandler(name string) http.Handler {
time.Sleep(duration) time.Sleep(duration)
fmt.Fprintf( fmt.Fprintf(
w, w,
"%s started at %s slept for %d nanoseconds.\n", "%s started at %s slept for %d nanoseconds from pid %d.\n",
name, name,
now, now,
duration.Nanoseconds(), duration.Nanoseconds(),
os.Getpid(),
) )
}) })
return mux return mux