From 49e6369fe732c0f81e5b03b36e345afbf3c79a15 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 24 Jul 2024 12:08:49 +0200 Subject: pkg/stat: rename package name to singular form Go package names should generally be singular form: https://go.dev/blog/package-names https://rakyll.org/style-packages https://groups.google.com/g/golang-nuts/c/buBwLar1gNw --- pkg/rpcserver/rpcserver.go | 40 ++++++++++++++++++++-------------------- pkg/rpcserver/runner.go | 14 +++++++------- 2 files changed, 27 insertions(+), 27 deletions(-) (limited to 'pkg/rpcserver') diff --git a/pkg/rpcserver/rpcserver.go b/pkg/rpcserver/rpcserver.go index 0b7d566bb..b371785d4 100644 --- a/pkg/rpcserver/rpcserver.go +++ b/pkg/rpcserver/rpcserver.go @@ -23,7 +23,7 @@ import ( "github.com/google/syzkaller/pkg/log" "github.com/google/syzkaller/pkg/mgrconfig" "github.com/google/syzkaller/pkg/signal" - "github.com/google/syzkaller/pkg/stats" + "github.com/google/syzkaller/pkg/stat" "github.com/google/syzkaller/pkg/vminfo" "github.com/google/syzkaller/prog" "github.com/google/syzkaller/sys/targets" @@ -58,8 +58,8 @@ type Manager interface { type Server struct { Port int - StatExecs *stats.Val - StatNumFuzzing *stats.Val + StatExecs *stat.Val + StatNumFuzzing *stat.Val cfg *Config mgr Manager @@ -81,7 +81,7 @@ type Server struct { runners map[string]*Runner execSource queue.Source triagedCorpus atomic.Bool - statVMRestarts *stats.Val + statVMRestarts *stat.Val *runnerStats } @@ -144,24 +144,24 @@ func newImpl(ctx context.Context, cfg *Config, mgr Manager) (*Server, error) { baseSource: baseSource, execSource: queue.Retry(baseSource), - StatExecs: stats.New("exec total", "Total test program executions", - stats.Console, stats.Rate{}, stats.Prometheus("syz_exec_total")), - StatNumFuzzing: stats.New("fuzzing VMs", "Number of VMs that are currently fuzzing", - stats.Console, stats.Link("/vms")), - statVMRestarts: stats.New("vm restarts", "Total number of VM starts", - stats.Rate{}, stats.NoGraph), + StatExecs: stat.New("exec total", "Total test program executions", + stat.Console, stat.Rate{}, stat.Prometheus("syz_exec_total")), + StatNumFuzzing: stat.New("fuzzing VMs", "Number of VMs that are currently fuzzing", + stat.Console, stat.Link("/vms")), + statVMRestarts: stat.New("vm restarts", "Total number of VM starts", + stat.Rate{}, stat.NoGraph), runnerStats: &runnerStats{ - statExecRetries: stats.New("exec retries", + statExecRetries: stat.New("exec retries", "Number of times a test program was restarted because the first run failed", - stats.Rate{}, stats.Graph("executor")), - statExecutorRestarts: stats.New("executor restarts", - "Number of times executor process was restarted", stats.Rate{}, stats.Graph("executor")), - statExecBufferTooSmall: stats.New("buffer too small", - "Program serialization overflowed exec buffer", stats.NoGraph), - statNoExecRequests: stats.New("no exec requests", - "Number of times fuzzer was stalled with no exec requests", stats.Rate{}), - statNoExecDuration: stats.New("no exec duration", - "Total duration fuzzer was stalled with no exec requests (ns/sec)", stats.Rate{}), + stat.Rate{}, stat.Graph("executor")), + statExecutorRestarts: stat.New("executor restarts", + "Number of times executor process was restarted", stat.Rate{}, stat.Graph("executor")), + statExecBufferTooSmall: stat.New("buffer too small", + "Program serialization overflowed exec buffer", stat.NoGraph), + statNoExecRequests: stat.New("no exec requests", + "Number of times fuzzer was stalled with no exec requests", stat.Rate{}), + statNoExecDuration: stat.New("no exec duration", + "Total duration fuzzer was stalled with no exec requests (ns/sec)", stat.Rate{}), }, } serv.runnerStats.statExecs = serv.StatExecs diff --git a/pkg/rpcserver/runner.go b/pkg/rpcserver/runner.go index 21b270421..a0b519d20 100644 --- a/pkg/rpcserver/runner.go +++ b/pkg/rpcserver/runner.go @@ -18,7 +18,7 @@ import ( "github.com/google/syzkaller/pkg/fuzzer/queue" "github.com/google/syzkaller/pkg/log" "github.com/google/syzkaller/pkg/osutil" - "github.com/google/syzkaller/pkg/stats" + "github.com/google/syzkaller/pkg/stat" "github.com/google/syzkaller/prog" "github.com/google/syzkaller/sys/targets" "github.com/google/syzkaller/vm/dispatcher" @@ -54,12 +54,12 @@ type Runner struct { } type runnerStats struct { - statExecs *stats.Val - statExecRetries *stats.Val - statExecutorRestarts *stats.Val - statExecBufferTooSmall *stats.Val - statNoExecRequests *stats.Val - statNoExecDuration *stats.Val + statExecs *stat.Val + statExecRetries *stat.Val + statExecutorRestarts *stat.Val + statExecBufferTooSmall *stat.Val + statNoExecRequests *stat.Val + statNoExecDuration *stat.Val } type handshakeConfig struct { -- cgit mrf-deployment