Skip to content

Commit

Permalink
Test data pull request failure
Browse files Browse the repository at this point in the history
  • Loading branch information
lovesh-ap committed Oct 1, 2024
1 parent c9f6773 commit 9e95214
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.newrelic.api.agent.security.NewRelicSecurity;
import com.newrelic.api.agent.security.instrumentation.helpers.GrpcClientRequestReplayHelper;
import org.apache.commons.lang3.StringUtils;
import sun.rmi.runtime.Log;

import java.time.Instant;
import java.util.HashMap;
Expand Down Expand Up @@ -89,6 +90,8 @@ private void task() {
return;
}

logger.log(LogLevel.FINEST, String.format("IAST data pull request started currentFetchThreshold %s", currentFetchThreshold), IASTDataTransferRequestProcessor.class.getName());

int fetchRatio = 300/currentFetchThreshold;

int remainingRecordCapacityRest = RestRequestThreadPool.getInstance().getQueue().remainingCapacity();
Expand All @@ -104,6 +107,8 @@ private void task() {
batchSize /= 2;
}

logger.log(LogLevel.FINEST, String.format("IAST data pull request batchSize: %s, remainingRecordCapacity %s, initiate: %s", batchSize, remainingRecordCapacity, (batchSize > 100/fetchRatio && remainingRecordCapacity > batchSize)), IASTDataTransferRequestProcessor.class.getName());

if (batchSize > 100/fetchRatio && remainingRecordCapacity > batchSize) {
request = new IASTDataTransferRequest(NewRelicSecurity.getAgent().getAgentUUID());
if (AgentConfig.getInstance().getConfig().getCustomerInfo() != null) {
Expand All @@ -118,6 +123,7 @@ private void task() {
pendingRequestIds.addAll(RestRequestThreadPool.getInstance().getPendingIds());
pendingRequestIds.addAll(GrpcClientRequestReplayHelper.getInstance().getPendingIds());
request.setPendingRequestIds(pendingRequestIds);
logger.log(LogLevel.FINEST, "IAST data pull request to be sent: " + JsonConverter.toJSON(request), IASTDataTransferRequestProcessor.class.getName());
WSClient.getInstance().send(request.toString());
}
} catch (Throwable e) {
Expand Down

0 comments on commit 9e95214

Please sign in to comment.