Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1250)

Unified Diff: fuzzer/go/generator/afl_generation.go

Issue 1682363003: Migrate fuzzer to use shiny new metrics2 package (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: one last _ to - Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fuzzer/go/fuzzer-fe/main.go ('k') | fuzzer/sys/fuzzer-be.service » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fuzzer/go/generator/afl_generation.go
diff --git a/fuzzer/go/generator/afl_generation.go b/fuzzer/go/generator/afl_generation.go
index 46f0ab52f0759e434d7f08926a1d2b6e5a35a699..c16e91cbc14e8a0a381fea73db5bdb19d2f46b74 100644
--- a/fuzzer/go/generator/afl_generation.go
+++ b/fuzzer/go/generator/afl_generation.go
@@ -7,19 +7,19 @@ import (
"path/filepath"
"strings"
- go_metrics "github.com/rcrowley/go-metrics"
"github.com/skia-dev/glog"
"go.skia.org/infra/fuzzer/go/common"
"go.skia.org/infra/fuzzer/go/config"
"go.skia.org/infra/go/exec"
"go.skia.org/infra/go/fileutil"
"go.skia.org/infra/go/gs"
+ "go.skia.org/infra/go/metrics2"
"google.golang.org/cloud/storage"
)
type Generator struct {
Category string
- fuzzProcessCount go_metrics.Counter
+ fuzzProcessCount *metrics2.Counter
fuzzProcesses []exec.Process
}
@@ -58,7 +58,7 @@ func (g *Generator) Start() error {
// TODO(kjlubick): Make this actually an intelligent number based on the number of cores.
fuzzCount = 10
}
- g.fuzzProcessCount = go_metrics.NewRegisteredCounter("afl_fuzz_process_count", go_metrics.DefaultRegistry)
+ g.fuzzProcessCount = metrics2.NewCounter("afl-fuzz-process-count", map[string]string{"category": g.Category})
g.fuzzProcessCount.Inc(int64(fuzzCount))
for i := 1; i < fuzzCount; i++ {
fuzzerName := fmt.Sprintf("fuzzer%d", i)
@@ -125,7 +125,7 @@ func (g *Generator) run(command *exec.Command) exec.Process {
go func() {
err := <-status
g.fuzzProcessCount.Dec(int64(1))
- glog.Infof(`[%s] afl fuzzer with args %q ended with error "%v". There are %d fuzzers remaining`, g.Category, command.Args, err, g.fuzzProcessCount.Count())
+ glog.Infof(`[%s] afl fuzzer with args %q ended with error "%v". There are %d fuzzers remaining`, g.Category, command.Args, err, g.fuzzProcessCount.Get())
}()
return p
}
« no previous file with comments | « fuzzer/go/fuzzer-fe/main.go ('k') | fuzzer/sys/fuzzer-be.service » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698