aboutsummaryrefslogtreecommitdiff
path: root/internal/options/options.go
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus@rgdd.se>2023-04-02 14:32:27 +0200
committerRasmus Dahlberg <rasmus@rgdd.se>2023-04-02 14:33:42 +0200
commit5e3af2cb3c003f4c328478ec9d938f103f5c08a6 (patch)
treed6e50318a28a6faec0d33a64c5f8e68012a0a421 /internal/options/options.go
parent89e2b5f0bbbf9b2e3e6bc7f30a12e28e7109d82b (diff)
Clean options that we're not planning to use
Diffstat (limited to 'internal/options/options.go')
-rw-r--r--internal/options/options.go28
1 files changed, 7 insertions, 21 deletions
diff --git a/internal/options/options.go b/internal/options/options.go
index 9a9a38c..e98d6eb 100644
--- a/internal/options/options.go
+++ b/internal/options/options.go
@@ -6,35 +6,21 @@ import (
)
type Options struct {
- // Input file
- InputFile string
- MaxFileBuffer int
- StartLineInclusive int64
- EndLineExclusive int64
-
- // Website visits
- NumWorkers int
- Timeout time.Duration
- MaxResponse int64
-
- // Health and metrics
- MetricsInterval time.Duration
+ InputFile string
+ NumWorkers int
Limit int
+ MaxResponse int64
+ Timeout time.Duration
+ MetricsInterval time.Duration
}
func Parse() (opts Options) {
flag.StringVar(&opts.InputFile, "i", "", "input file, one domain name per line")
- flag.IntVar(&opts.MaxFileBuffer, "b", 512, "max bytes to read from input file at once in MiB")
- flag.Int64Var(&opts.StartLineInclusive, "s", 0, "first line to read in input file, inclusive and zero-based index")
- flag.Int64Var(&opts.EndLineExclusive, "e", 0, "last line to read in input file, exclusive and zero-based; 0 to disable")
-
flag.IntVar(&opts.NumWorkers, "w", 32, "number of parallel workers")
- flag.DurationVar(&opts.Timeout, "t", 10*time.Second, "timeout for each website visit")
+ flag.IntVar(&opts.Limit, "l", 16, "rate-limit that kicks in before handing out work in requests/s")
flag.Int64Var(&opts.MaxResponse, "r", 128, "max response body size to accept in MiB")
-
+ flag.DurationVar(&opts.Timeout, "t", 10*time.Second, "timeout for each website visit")
flag.DurationVar(&opts.MetricsInterval, "m", 5*time.Second, "how often to emit metrics")
- flag.IntVar(&opts.Limit, "l", 16, "rate-limit that kicks in before handing out work in requests/s")
-
flag.Parse()
return
}