include pid in sleep response
This commit is contained in:
parent
308a01b46b
commit
07af98f40b
@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"github.com/daaku/go.grace/gracehttp"
|
||||
"net/http"
|
||||
"os"
|
||||
"time"
|
||||
)
|
||||
|
||||
@ -36,10 +37,11 @@ func newHandler(name string) http.Handler {
|
||||
time.Sleep(duration)
|
||||
fmt.Fprintf(
|
||||
w,
|
||||
"%s started at %s slept for %d nanoseconds.\n",
|
||||
"%s started at %s slept for %d nanoseconds from pid %d.\n",
|
||||
name,
|
||||
now,
|
||||
duration.Nanoseconds(),
|
||||
os.Getpid(),
|
||||
)
|
||||
})
|
||||
return mux
|
||||
|
Loading…
Reference in New Issue
Block a user