Skip to content

Commit

Permalink
#440 add time (#495)
Browse files Browse the repository at this point in the history
Signed-off-by: 6za <[email protected]>

Signed-off-by: 6za <[email protected]>
  • Loading branch information
6za authored Oct 4, 2022
1 parent 8228dca commit 2b2c7ad
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
10 changes: 10 additions & 0 deletions cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cmd

import (
"log"
"time"

"github.com/kubefirst/kubefirst/internal/gitlab"
"github.com/kubefirst/kubefirst/internal/state"
Expand All @@ -18,6 +19,15 @@ var createCmd = &cobra.Command{
Short: "create a kubefirst management cluster",
Long: `TBD`,
RunE: func(cmd *cobra.Command, args []string) error {
start := time.Now()
defer func() {
//The goal of this code is to track create time, if it works or not.
//In the future we can add telemetry signal from these action, to track, success or fail.
duration := time.Since(start)
log.Printf("[000] Create duration is %s", duration)

}()

globalFlags, err := flagset.ProcessGlobalFlags(cmd)
if err != nil {
return err
Expand Down
8 changes: 8 additions & 0 deletions cmd/deployMetaphor.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package cmd

import (
"log"
"time"

"github.com/kubefirst/kubefirst/internal/flagset"
"github.com/kubefirst/kubefirst/internal/metaphor"
Expand All @@ -20,6 +21,13 @@ var deployMetaphorCmd = &cobra.Command{
Long: `TBD`,
RunE: func(cmd *cobra.Command, args []string) error {
log.Println("deployMetaphor called")
start := time.Now()
defer func() {
//The goal of this code is to track execution time
duration := time.Since(start)
log.Printf("[000] deploy-metaphor duration is %s", duration)

}()

if viper.GetBool("option.metaphor.skip") {
log.Println("[99] Deployment of metpahor microservices skiped")
Expand Down
8 changes: 7 additions & 1 deletion cmd/k1Ready.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ var k1ReadyCmd = &cobra.Command{
Short: "Verify the status of key apps",
Long: `TBD`,
RunE: func(cmd *cobra.Command, args []string) error {
log.Println("argocdAppStatus called")
start := time.Now()
defer func() {
//The goal of this code is to track execution time
duration := time.Since(start)
log.Printf("[000] K1-Ready duration is %s", duration)

}()
config := configs.ReadConfig()

globalFlags, err := flagset.ProcessGlobalFlags(cmd)
Expand Down

0 comments on commit 2b2c7ad

Please sign in to comment.