Skip to content

Commit

Permalink
Add example usage of flag and timestamp to the logs
Browse files Browse the repository at this point in the history
Signed-off-by: Sergen Yalçın <[email protected]>
  • Loading branch information
sergenyalcin committed Sep 8, 2023
1 parent 7512106 commit 0390516
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions cmd/perf/internal/managed/managed.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ func applyResources(mrTemplatePaths map[string]int, applyInterval time.Duration)
if err := runApplyCommand(f); err != nil {
return nil, err
}
time.Sleep(applyInterval)
if i != count {
time.Sleep(applyInterval)
}
tmpFiles = append(tmpFiles, f.Name())
}
}
Expand Down Expand Up @@ -319,7 +321,7 @@ func runCommand(command string) error {
sc := bufio.NewScanner(stdout)
sc.Split(bufio.ScanLines)
for sc.Scan() {
fmt.Println(sc.Text())
log.Info(sc.Text())
}
if err := cmd.Wait(); err != nil {
return errors.Wrap(err, "cannot wait for the command exit")
Expand Down
2 changes: 1 addition & 1 deletion cmd/perf/internal/quantify.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func NewCmdQuantify() *cobra.Command {
o.cmd.Flags().DurationVar(&o.stepDuration, "step-duration", 1*time.Second, "Step duration between two data points")
o.cmd.Flags().BoolVar(&o.clean, "clean", true, "Delete deployed MRs")
o.cmd.Flags().StringVar(&o.nodeIP, "node", "", "Node IP")
o.cmd.Flags().DurationVar(&o.applyInterval, "apply-interval", 0*time.Second, "Elapsed time between applying two manifests to the cluster")
o.cmd.Flags().DurationVar(&o.applyInterval, "apply-interval", 0*time.Second, "Elapsed time between applying two manifests to the cluster. Example = 10s. This means that examples will be applied every 10 seconds.")
o.cmd.Flags().DurationVar(&o.timeout, "timeout", 120*time.Minute, "Timeout for the experiment")

if err := o.cmd.MarkFlagRequired("provider-pods"); err != nil {
Expand Down

0 comments on commit 0390516

Please sign in to comment.