Skip to content

Commit

Permalink
Print start-up timings as human-readable approximation
Browse files Browse the repository at this point in the history
Signed-off-by: Han Verstraete <[email protected]>
  • Loading branch information
welteki authored and alexellis committed Apr 2, 2022
1 parent e09f37e commit 7bd8476
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -68,15 +69,15 @@ 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 {
return err
}
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
Expand Down

0 comments on commit 7bd8476

Please sign in to comment.