Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* callback about being 'overloaded' Please see {@link BroadcastConfig#throttleOutputQueueThreshold()},
* {@link BroadcastConfig#disablePingThreshold()} and {@link BroadcastConfig#pauseOnLag()} for configuration
* options
* This class is not thread safe, all methods should be called from the same thread.
*/
public class RpcOverloadMonitor {

Expand All @@ -24,8 +25,8 @@ public class RpcOverloadMonitor {
private final Time time;
private final Consumer<Boolean> communicationOverloadHandler;

private volatile long disabledBroadcastDueToQueueSizeTime = ENABLED;
private volatile long disabledBroadcastDueToLagTime = ENABLED;
private long disabledBroadcastDueToQueueSizeTime = ENABLED;
private long disabledBroadcastDueToLagTime = ENABLED;

public RpcOverloadMonitor(
@NonNull final BroadcastConfig syncConfig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,10 @@ private void readMessages(@NonNull final Connection connection) throws IOExcepti
final long correlationId = input.readLong();
final long pingMillis =
TimeUnit.NANOSECONDS.toMillis(pingHandler.handleIncomingPingReply(correlationId));
overloadMonitor.reportPing(pingMillis);
// we are still reporting delay to receive, not to handle
// we want to measure the network ping, rather than dispatch thread ping
// it is still handled over there, to make overloadMonitor managed from same thread
inputQueue.add(() -> overloadMonitor.reportPing(pingMillis));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know at one point, we had performance problems that were traced back to the creation of too many lambda objects. I don't know if it is still something we need to be careful with. Is there a way to solve the problem with the lambdas?

break;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
package com.swirlds.platform.gossip;
package org.hiero.consensus.gossip.impl.gossip;

// this class should be moved to a different package, but modules are WIP as of now and it is not possible to do that
// without breaking build
Expand Down
Loading