include pid in sleep response
This commit is contained in:
parent
308a01b46b
commit
07af98f40b
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user