From 50d211d1a4c42e4e39a9daa41ad53150abfe24c0 Mon Sep 17 00:00:00 2001 From: Anton Tolchanov Date: Mon, 20 Mar 2023 15:14:05 +0000 Subject: [PATCH] cmd/derpprobe: allow running all probes at the same time This allows disabling spread mode, which is helpful if you are manually running derpprobe in `--once` mode against a small number of DERP machines. Updates https://github.com/tailscale/corp/issues/9916 Signed-off-by: Anton Tolchanov --- cmd/derpprobe/derpprobe.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/derpprobe/derpprobe.go b/cmd/derpprobe/derpprobe.go index 56e08ae64..3a295250b 100644 --- a/cmd/derpprobe/derpprobe.go +++ b/cmd/derpprobe/derpprobe.go @@ -23,13 +23,14 @@ var ( derpMapURL = flag.String("derp-map", "https://login.tailscale.com/derpmap/default", "URL to DERP map (https:// or file://)") listen = flag.String("listen", ":8030", "HTTP listen address") probeOnce = flag.Bool("once", false, "probe once and print results, then exit; ignores the listen flag") + spread = flag.Bool("spread", true, "whether to spread probing over time") interval = flag.Duration("interval", 15*time.Second, "probe interval") ) func main() { flag.Parse() - p := prober.New().WithSpread(true).WithOnce(*probeOnce) + p := prober.New().WithSpread(*spread).WithOnce(*probeOnce) dp, err := prober.DERP(p, *derpMapURL, *interval, *interval, *interval) if err != nil { log.Fatal(err)