Skip to content

Commit

Permalink
fix min_latency (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
JackyWoo authored Aug 17, 2023
1 parent 84f81e0 commit cd30547
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
5 changes: 0 additions & 5 deletions programs/server/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@
<!-- <log_to_console>false</log_to_console> -->
</logger>

<!-- <core_dump> -->
<!-- 1 GiB by default. If more - it writes to disk too long. -->
<!-- <size_limit>1073741824</size_limit> -->
<!-- </core_dump> -->

<keeper>
<!-- My id in cluster. -->
<my_id>1</my_id>
Expand Down
6 changes: 3 additions & 3 deletions src/Service/ConnectionStats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace RK

uint64_t ConnectionStats::getMinLatency() const
{
return min_latency;
return min_latency == std::numeric_limits<uint64_t>::max() ? static_cast<uint64_t>(0): min_latency;
}

uint64_t ConnectionStats::getMaxLatency() const
Expand Down Expand Up @@ -48,7 +48,7 @@ void ConnectionStats::incrementPacketsSent()
void ConnectionStats::updateLatency(uint64_t latency_ms)
{
last_latency = latency_ms;
total_latency += (latency_ms);
total_latency += latency_ms;
count++;

if (latency_ms < min_latency)
Expand All @@ -73,8 +73,8 @@ void ConnectionStats::resetLatency()
total_latency = 0;
count = 0;
max_latency = 0;
min_latency = 0;
last_latency = 0;
min_latency = std::numeric_limits<uint64_t>::max();
}

void ConnectionStats::resetRequestCounters()
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_four_word_command/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ def test_cmd_crst(started_cluster):
assert result['lzxid'] == '0xffffffffffffffff'
assert result['lresp'] == '0'
assert int(result['llat']) == 0
assert int(result['minlat']) == 18446744073709551615
assert int(result['minlat']) == 0
assert int(result['avglat']) == 0
assert int(result['maxlat']) == 0

Expand Down

0 comments on commit cd30547

Please sign in to comment.