Skip to content

Commit 93deb53

Browse files
authored
chore: correct a constant for dummy latency in measurement (#210)
1 parent 0c2299c commit 93deb53

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/redis_client/cluster/node/latency_replica.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class LatencyReplica
1010

1111
attr_reader :replica_clients
1212

13-
DUMMY_LATENCY_NSEC = 100 * 1000 * 1000 * 1000
13+
DUMMY_LATENCY_MSEC = 100 * 1000 * 1000
1414
MEASURE_ATTEMPT_COUNT = 10
1515

1616
def initialize(replications, options, pool, **kwargs)
@@ -45,7 +45,7 @@ def measure_latencies(clients) # rubocop:disable Metrics/AbcSize
4545
Thread.new(k, v) do |node_key, client|
4646
Thread.current[:node_key] = node_key
4747

48-
min = DUMMY_LATENCY_NSEC
48+
min = DUMMY_LATENCY_MSEC
4949
MEASURE_ATTEMPT_COUNT.times do
5050
starting = Process.clock_gettime(Process::CLOCK_MONOTONIC, :microsecond)
5151
client.call_once('PING')
@@ -55,7 +55,7 @@ def measure_latencies(clients) # rubocop:disable Metrics/AbcSize
5555

5656
Thread.current[:latency] = min
5757
rescue StandardError
58-
Thread.current[:latency] = DUMMY_LATENCY_NSEC
58+
Thread.current[:latency] = DUMMY_LATENCY_MSEC
5959
end
6060
end
6161

0 commit comments

Comments
 (0)