From 1f032c27c8158e44723253179928104813d45cdc Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 24 Jul 2024 11:32:41 +0200 Subject: pkg/stats: rename Create to New New is more idiomatic name and is shorter (lines where stats.Create is used are usually long, so making them a bit shorter is good). --- pkg/fuzzer/cover.go | 2 +- pkg/fuzzer/stats.go | 38 +++++++++++++++++++------------------- 2 files changed, 20 insertions(+), 20 deletions(-) (limited to 'pkg/fuzzer') diff --git a/pkg/fuzzer/cover.go b/pkg/fuzzer/cover.go index 4421693b1..876d2f4dc 100644 --- a/pkg/fuzzer/cover.go +++ b/pkg/fuzzer/cover.go @@ -19,7 +19,7 @@ type Cover struct { func newCover() *Cover { cover := new(Cover) - stats.Create("max signal", "Maximum fuzzing signal (including flakes)", + stats.New("max signal", "Maximum fuzzing signal (including flakes)", stats.Graph("signal"), stats.LenOf(&cover.maxSignal, &cover.mu)) return cover } diff --git a/pkg/fuzzer/stats.go b/pkg/fuzzer/stats.go index db2dfd3b3..11f98f2a6 100644 --- a/pkg/fuzzer/stats.go +++ b/pkg/fuzzer/stats.go @@ -29,37 +29,37 @@ type Stats struct { func newStats() Stats { return Stats{ - statCandidates: stats.Create("candidates", "Number of candidate programs in triage queue", + statCandidates: stats.New("candidates", "Number of candidate programs in triage queue", stats.Console, stats.Graph("corpus")), - statNewInputs: stats.Create("new inputs", "Potential untriaged corpus candidates", + statNewInputs: stats.New("new inputs", "Potential untriaged corpus candidates", stats.Graph("corpus")), - statJobs: stats.Create("fuzzer jobs", "Total running fuzzer jobs", stats.NoGraph), - statJobsTriage: stats.Create("triage jobs", "Running triage jobs", stats.StackedGraph("jobs")), - statJobsTriageCandidate: stats.Create("candidate triage jobs", "Running candidate triage jobs", + statJobs: stats.New("fuzzer jobs", "Total running fuzzer jobs", stats.NoGraph), + statJobsTriage: stats.New("triage jobs", "Running triage jobs", stats.StackedGraph("jobs")), + statJobsTriageCandidate: stats.New("candidate triage jobs", "Running candidate triage jobs", stats.StackedGraph("jobs")), - statJobsSmash: stats.Create("smash jobs", "Running smash jobs", stats.StackedGraph("jobs")), - statJobsFaultInjection: stats.Create("fault jobs", "Running fault injection jobs", stats.StackedGraph("jobs")), - statJobsHints: stats.Create("hints jobs", "Running hints jobs", stats.StackedGraph("jobs")), - statExecTime: stats.Create("prog exec time", "Test program execution time (ms)", stats.Distribution{}), - statExecGenerate: stats.Create("exec gen", "Executions of generated programs", stats.Rate{}, + statJobsSmash: stats.New("smash jobs", "Running smash jobs", stats.StackedGraph("jobs")), + statJobsFaultInjection: stats.New("fault jobs", "Running fault injection jobs", stats.StackedGraph("jobs")), + statJobsHints: stats.New("hints jobs", "Running hints jobs", stats.StackedGraph("jobs")), + statExecTime: stats.New("prog exec time", "Test program execution time (ms)", stats.Distribution{}), + statExecGenerate: stats.New("exec gen", "Executions of generated programs", stats.Rate{}, stats.StackedGraph("exec")), - statExecFuzz: stats.Create("exec fuzz", "Executions of mutated programs", + statExecFuzz: stats.New("exec fuzz", "Executions of mutated programs", stats.Rate{}, stats.StackedGraph("exec")), - statExecCandidate: stats.Create("exec candidate", "Executions of candidate programs", + statExecCandidate: stats.New("exec candidate", "Executions of candidate programs", stats.Rate{}, stats.StackedGraph("exec")), - statExecTriage: stats.Create("exec triage", "Executions of corpus triage programs", + statExecTriage: stats.New("exec triage", "Executions of corpus triage programs", stats.Rate{}, stats.StackedGraph("exec")), - statExecMinimize: stats.Create("exec minimize", "Executions of programs during minimization", + statExecMinimize: stats.New("exec minimize", "Executions of programs during minimization", stats.Rate{}, stats.StackedGraph("exec")), - statExecSmash: stats.Create("exec smash", "Executions of smashed programs", + statExecSmash: stats.New("exec smash", "Executions of smashed programs", stats.Rate{}, stats.StackedGraph("exec")), - statExecFaultInject: stats.Create("exec inject", "Executions of fault injection", + statExecFaultInject: stats.New("exec inject", "Executions of fault injection", stats.Rate{}, stats.StackedGraph("exec")), - statExecHint: stats.Create("exec hints", "Executions of programs generated using hints", + statExecHint: stats.New("exec hints", "Executions of programs generated using hints", stats.Rate{}, stats.StackedGraph("exec")), - statExecSeed: stats.Create("exec seeds", "Executions of programs for hints extraction", + statExecSeed: stats.New("exec seeds", "Executions of programs for hints extraction", stats.Rate{}, stats.StackedGraph("exec")), - statExecCollide: stats.Create("exec collide", "Executions of programs in collide mode", + statExecCollide: stats.New("exec collide", "Executions of programs in collide mode", stats.Rate{}, stats.StackedGraph("exec")), } } -- cgit mrf-deployment