Commit 5e03fd1 1 parent c9454f1 commit 5e03fd1 Copy full SHA for 5e03fd1
File tree 3 files changed +18
-6
lines changed
newrelic-security-agent/src/main/java/com/newrelic
agent/security/intcodeagent
3 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ public void reset(){
36
36
this .iastEvents .reset ();
37
37
this .dispatcher .reset ();
38
38
this .exitEvents .reset ();
39
+ this .droppedDueTo .reset ();
39
40
}
40
41
41
42
public String toString () {
Original file line number Diff line number Diff line change 1
1
package com .newrelic .agent .security .intcodeagent .websocket ;
2
2
3
3
import com .newrelic .agent .security .AgentInfo ;
4
+ import com .newrelic .agent .security .instrumentator .dispatcher .Dispatcher ;
4
5
import com .newrelic .agent .security .instrumentator .httpclient .RestRequestThreadPool ;
5
6
import com .newrelic .agent .security .intcodeagent .executor .CustomFutureTask ;
6
7
import com .newrelic .agent .security .intcodeagent .executor .CustomThreadPoolExecutor ;
@@ -44,11 +45,21 @@ private EventSendPool() {
44
45
@ Override
45
46
protected void afterExecute (Runnable r , Throwable t ) {
46
47
try {
47
- if (t != null ) {
48
- AgentInfo .getInstance ().getJaHealthCheck ().getEventStats ().getEventSender ().incrementError ();
49
- } else {
50
- AgentInfo .getInstance ().getJaHealthCheck ().getEventStats ().getEventSender ().incrementCompleted ();
48
+ if (r instanceof CustomFutureTask <?> && ((CustomFutureTask <?>) r ).getTask () instanceof EventSender ) {
49
+ EventSender task = (EventSender ) ((CustomFutureTask <?>) r ).get ();
50
+ if (task .getEvent () instanceof JavaAgentEventBean ){
51
+ if (t != null ) {
52
+ AgentInfo .getInstance ().getJaHealthCheck ().getEventStats ().getEventSender ().incrementError ();
53
+ } else {
54
+ AgentInfo .getInstance ().getJaHealthCheck ().getEventStats ().getEventSender ().incrementCompleted ();
55
+ }
56
+ }
51
57
}
58
+ // if (t != null) {
59
+ // AgentInfo.getInstance().getJaHealthCheck().getEventStats().getEventSender().incrementError();
60
+ // } else {
61
+ // AgentInfo.getInstance().getJaHealthCheck().getEventStats().getEventSender().incrementCompleted();
62
+ // }
52
63
} catch (Throwable ignored ){}
53
64
super .afterExecute (r , t );
54
65
}
Original file line number Diff line number Diff line change @@ -298,15 +298,15 @@ public void registerOperation(AbstractOperation operation) {
298
298
logger .log (LogLevel .FINEST , DROPPING_EVENT_AS_IT_WAS_GENERATED_BY_K_2_INTERNAL_API_CALL +
299
299
JsonConverter .toJSON (operation ),
300
300
Agent .class .getName ());
301
- AgentInfo .getInstance ().getJaHealthCheck ().getEventStats ().getDroppedDueTo ().getCsecInternalEvent ();
301
+ AgentInfo .getInstance ().getJaHealthCheck ().getEventStats ().getDroppedDueTo ().incrementCsecInternalEvent ();
302
302
return ;
303
303
}
304
304
305
305
if (!NewRelic .getAgent ().getConfig ().getValue (IUtilConstants .NR_SECURITY_HOME_APP , false ) && checkIfNRGeneratedEvent (operation )) {
306
306
logger .log (LogLevel .FINEST , DROPPING_EVENT_AS_IT_WAS_GENERATED_BY_K_2_INTERNAL_API_CALL +
307
307
JsonConverter .toJSON (operation ),
308
308
Agent .class .getName ());
309
- AgentInfo .getInstance ().getJaHealthCheck ().getEventStats ().getDroppedDueTo ().getNrInternalEvent ();
309
+ AgentInfo .getInstance ().getJaHealthCheck ().getEventStats ().getDroppedDueTo ().incrementNrInternalEvent ();
310
310
return ;
311
311
}
312
312
You can’t perform that action at this time.
0 commit comments