Skip to content

Commit

Permalink
Re #86: Changing buffer to off heap - it might help with alignment is…
Browse files Browse the repository at this point in the history
…sues on 32bit. (#117)
  • Loading branch information
tkowalcz committed Sep 1, 2023
1 parent 67fda17 commit 1b29ea3
Showing 1 changed file with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.agrona.concurrent.UnsafeBuffer;
import org.agrona.concurrent.errors.DistinctErrorLog;

import java.nio.ByteBuffer;
import java.util.concurrent.atomic.AtomicLong;

public class StandardMonitoringModule implements MonitoringModule {
Expand Down Expand Up @@ -31,7 +32,7 @@ public StandardMonitoringModule() {
}

distinctErrorLog = new DistinctErrorLog(
new UnsafeBuffer(new byte[ERROR_LOG_CAPACITY]),
new UnsafeBuffer(ByteBuffer.allocateDirect(ERROR_LOG_CAPACITY)),
new SystemEpochClock()
);

Expand Down Expand Up @@ -130,15 +131,15 @@ public void recordResponseTime(long time) {
@Override
public String toString() {
return "StandardMonitoringModule{" +
"droppedPuts=" + droppedPuts +
", httpConnectAttempts=" + httpConnectAttempts +
", sentHttpRequests=" + sentHttpRequests +
", sentKilobytes=" + (sentBytes.longValue() / 1024) +
", failedHttpRequests=" + failedHttpRequests +
", retriedHttpRequests=" + retriedHttpRequests +
", httpResponses=" + httpResponses +
", channelInactive=" + channelInactive +
", agentErrors=" + agentErrors +
'}';
"droppedPuts=" + droppedPuts +
", httpConnectAttempts=" + httpConnectAttempts +
", sentHttpRequests=" + sentHttpRequests +
", sentKilobytes=" + (sentBytes.longValue() / 1024) +
", failedHttpRequests=" + failedHttpRequests +
", retriedHttpRequests=" + retriedHttpRequests +
", httpResponses=" + httpResponses +
", channelInactive=" + channelInactive +
", agentErrors=" + agentErrors +
'}';
}
}

0 comments on commit 1b29ea3

Please sign in to comment.