Print start-up timings as human-readable approximation

Signed-off-by: Han Verstraete <welteki@pm.me>
This commit is contained in:
Han Verstraete 2022-04-02 08:42:58 +00:00 committed by Alex Ellis
parent e09f37e5cb
commit 7bd84766f3

View File

@ -16,6 +16,7 @@ import (
"github.com/spf13/cobra"
flag "github.com/spf13/pflag"
units "github.com/docker/go-units"
"github.com/openfaas/faasd/pkg"
)
@ -68,7 +69,7 @@ func runUp(cmd *cobra.Command, _ []string) error {
return err
}
log.Printf("Supervisor created in: %s\n", time.Since(start).String())
log.Printf("Supervisor created in: %s\n", units.HumanDuration(time.Since(start)))
start = time.Now()
if err := supervisor.Start(services); err != nil {
@ -76,7 +77,7 @@ func runUp(cmd *cobra.Command, _ []string) error {
}
defer supervisor.Close()
log.Printf("Supervisor init done in: %s\n", time.Since(start).String())
log.Printf("Supervisor init done in: %s\n", units.HumanDuration(time.Since(start)))
shutdownTimeout := time.Second * 1
timeout := time.Second * 60