diff --git a/cmd/testbeacon.go b/cmd/testbeacon.go index e68b4d9cd..5d509d308 100644 --- a/cmd/testbeacon.go +++ b/cmd/testbeacon.go @@ -29,8 +29,10 @@ type testBeaconConfig struct { type testCaseBeacon func(context.Context, *testBeaconConfig, string) testResult const ( - thresholdBeaconPeersAvg = 20 - thresholdBeaconPeersBad = 5 + thresholdBeaconMeasureAvg = 40 * time.Millisecond + thresholdBeaconMeasureBad = 100 * time.Millisecond + thresholdBeaconPeersAvg = 50 + thresholdBeaconPeersBad = 20 ) func newTestBeaconCmd(runFunc func(context.Context, io.Writer, testBeaconConfig) error) *cobra.Command { @@ -256,9 +258,9 @@ func beaconPingMeasureTest(ctx context.Context, _ *testBeaconConfig, target stri return failedTestResult(testRes, errors.New("status code %v", z.Int("status_code", resp.StatusCode))) } - if firstByte > thresholdMeasureBad { + if firstByte > thresholdBeaconMeasureBad { testRes.Verdict = testVerdictBad - } else if firstByte > thresholdMeasureAvg { + } else if firstByte > thresholdBeaconMeasureAvg { testRes.Verdict = testVerdictAvg } else { testRes.Verdict = testVerdictGood diff --git a/cmd/testpeers.go b/cmd/testpeers.go index 55e4b15bf..12e2897f3 100644 --- a/cmd/testpeers.go +++ b/cmd/testpeers.go @@ -47,10 +47,14 @@ type testPeersConfig struct { type testCasePeer func(context.Context, *testPeersConfig, host.Host, p2p.Peer) testResult const ( - thresholdMeasureAvg = 200 * time.Millisecond - thresholdMeasureBad = 500 * time.Millisecond - thresholdLoadAvg = 200 * time.Millisecond - thresholdLoadBad = 500 * time.Millisecond + thresholdMeasureAvg = 50 * time.Millisecond + thresholdMeasureBad = 240 * time.Millisecond + thresholdLoadAvg = 50 * time.Millisecond + thresholdLoadBad = 240 * time.Millisecond + thresholdPeersMeasureAvg = 50 * time.Millisecond + thresholdPeersMeasureBad = 240 * time.Millisecond + thresholdPeersLoadAvg = 50 * time.Millisecond + thresholdPeersLoadBad = 240 * time.Millisecond ) func newTestPeersCmd(runFunc func(context.Context, io.Writer, testPeersConfig) error) *cobra.Command { @@ -502,9 +506,9 @@ func peerPingMeasureTest(ctx context.Context, _ *testPeersConfig, tcpNode host.H return failedTestResult(testRes, result.Error) } - if result.RTT > thresholdMeasureBad { + if result.RTT > thresholdPeersMeasureBad { testRes.Verdict = testVerdictBad - } else if result.RTT > thresholdMeasureAvg { + } else if result.RTT > thresholdPeersMeasureAvg { testRes.Verdict = testVerdictAvg } else { testRes.Verdict = testVerdictGood @@ -549,9 +553,9 @@ func peerPingLoadTest(ctx context.Context, conf *testPeersConfig, tcpNode host.H highestRTT = val.RTT } } - if highestRTT > thresholdLoadBad { + if highestRTT > thresholdPeersLoadBad { testRes.Verdict = testVerdictBad - } else if highestRTT > thresholdLoadAvg { + } else if highestRTT > thresholdPeersLoadAvg { testRes.Verdict = testVerdictAvg } else { testRes.Verdict = testVerdictGood