From e91dc5cb39a41fedaa970346b8c62e056863f488 Mon Sep 17 00:00:00 2001 From: Yevgeny Pats Date: Tue, 22 Oct 2019 09:09:04 +0300 Subject: [PATCH] Add timing for local regression runs --- client/client.go | 2 +- cmd/job.go | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/client/client.go b/client/client.go index 6799a80..648c5a4 100644 --- a/client/client.go +++ b/client/client.go @@ -11,7 +11,7 @@ import ( ) const FuzzitEndpoint = "https://app.fuzzit.dev" -const Version = "v2.4.73" +const Version = "v2.4.74" type Target struct { Name string `firestore:"target_name"` diff --git a/cmd/job.go b/cmd/job.go index 8a44f69..8b52d01 100644 --- a/cmd/job.go +++ b/cmd/job.go @@ -19,6 +19,7 @@ import ( "log" "strconv" "strings" + "time" "github.com/fuzzitdev/fuzzit/v2/client" "github.com/spf13/cobra" @@ -110,19 +111,23 @@ var jobCmd = &cobra.Command{ newJob.TargetId = target if newJob.Type == "local-regression" { + start := time.Now() err = gFuzzitClient.CreateLocalJob(newJob, args[1:]) if err != nil && skipIfNotExist && (err.Error() == "401 Unauthorized" || err.Error() == "fuzzer exited with 22") { log.Println("Target doesn't exist yet. skipping...") return } + diff := time.Now().Sub(start) + log.Printf("Regression for %s took %s seconds", target, diff) } else { _, err = gFuzzitClient.CreateJob(newJob, additionalCorpus, args[1:]) + log.Printf("Job created successfully") } if err != nil { log.Fatal(err) } - log.Printf("Job created successfully") + }, }