-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix sampling for line probe without condition #6135
Conversation
In the case of a line probe MethodLocation is DEFAULT and we should not consider the evaluteAt attribute as it is meant for method probe only
BenchmarksStartupParameters
See matching parameters
SummaryFound 2 performance improvements and 0 performance regressions! Performance is the same for 52 cases.
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.23.0-SNAPSHOT~ef53842d04, baseline=1.23.0-SNAPSHOT~20a70a4bbf
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.045 s) : 0, 1045146
Total [baseline] (9.453 s) : 0, 9452709
Agent [candidate] (1.038 s) : 0, 1038225
Total [candidate] (9.325 s) : 0, 9325189
section appsec
Agent [baseline] (1.119 s) : 0, 1118740
Total [baseline] (9.405 s) : 0, 9404595
Agent [candidate] (1.118 s) : 0, 1117912
Total [candidate] (9.426 s) : 0, 9426140
section iast
Agent [baseline] (1.159 s) : 0, 1158565
Total [baseline] (9.606 s) : 0, 9605652
Agent [candidate] (1.156 s) : 0, 1156464
Total [candidate] (9.526 s) : 0, 9526237
section profiling
Agent [baseline] (1.223 s) : 0, 1223054
Total [baseline] (9.532 s) : 0, 9532312
Agent [candidate] (1.22 s) : 0, 1220493
Total [candidate] (9.603 s) : 0, 9603179
gantt
title petclinic - break down per module: candidate=1.23.0-SNAPSHOT~ef53842d04, baseline=1.23.0-SNAPSHOT~20a70a4bbf
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (651.344 ms) : 0, 651344
BytebuddyAgent [candidate] (647.114 ms) : 0, 647114
GlobalTracer [baseline] (297.383 ms) : 0, 297383
GlobalTracer [candidate] (295.652 ms) : 0, 295652
AppSec [baseline] (49.525 ms) : 0, 49525
AppSec [candidate] (48.947 ms) : 0, 48947
Remote Config [baseline] (702.919 µs) : 0, 703
Remote Config [candidate] (702.801 µs) : 0, 703
Telemetry [baseline] (11.454 ms) : 0, 11454
Telemetry [candidate] (11.368 ms) : 0, 11368
section appsec
BytebuddyAgent [baseline] (645.002 ms) : 0, 645002
BytebuddyAgent [candidate] (644.307 ms) : 0, 644307
GlobalTracer [baseline] (293.414 ms) : 0, 293414
GlobalTracer [candidate] (293.601 ms) : 0, 293601
AppSec [baseline] (138.49 ms) : 0, 138490
AppSec [candidate] (138.191 ms) : 0, 138191
Remote Config [baseline] (643.427 µs) : 0, 643
Remote Config [candidate] (650.24 µs) : 0, 650
Telemetry [baseline] (6.88 ms) : 0, 6880
Telemetry [candidate] (6.871 ms) : 0, 6871
section iast
BytebuddyAgent [baseline] (771.183 ms) : 0, 771183
BytebuddyAgent [candidate] (771.035 ms) : 0, 771035
GlobalTracer [baseline] (275.757 ms) : 0, 275757
GlobalTracer [candidate] (275.141 ms) : 0, 275141
AppSec [baseline] (47.007 ms) : 0, 47007
AppSec [candidate] (46.78 ms) : 0, 46780
Remote Config [baseline] (585.005 µs) : 0, 585
Remote Config [candidate] (559.613 µs) : 0, 560
Telemetry [baseline] (12.632 ms) : 0, 12632
Telemetry [candidate] (11.344 ms) : 0, 11344
IAST [baseline] (16.755 ms) : 0, 16755
IAST [candidate] (16.949 ms) : 0, 16949
section profiling
BytebuddyAgent [baseline] (659.096 ms) : 0, 659096
BytebuddyAgent [candidate] (661.538 ms) : 0, 661538
GlobalTracer [baseline] (359.7 ms) : 0, 359700
GlobalTracer [candidate] (360.962 ms) : 0, 360962
AppSec [baseline] (49.261 ms) : 0, 49261
AppSec [candidate] (49.581 ms) : 0, 49581
Remote Config [baseline] (667.632 µs) : 0, 668
Remote Config [candidate] (656.732 µs) : 0, 657
Telemetry [baseline] (11.327 ms) : 0, 11327
Telemetry [candidate] (11.434 ms) : 0, 11434
ProfilingAgent [baseline] (88.493 ms) : 0, 88493
ProfilingAgent [candidate] (81.575 ms) : 0, 81575
Profiling [baseline] (88.517 ms) : 0, 88517
Profiling [candidate] (81.599 ms) : 0, 81599
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.23.0-SNAPSHOT~ef53842d04, baseline=1.23.0-SNAPSHOT~20a70a4bbf
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.037 s) : 0, 1037244
Total [baseline] (8.795 s) : 0, 8794582
Agent [candidate] (1.035 s) : 0, 1035295
Total [candidate] (8.78 s) : 0, 8779771
section iast
Agent [baseline] (1.147 s) : 0, 1147177
Total [baseline] (9.312 s) : 0, 9311591
Agent [candidate] (1.158 s) : 0, 1158370
Total [candidate] (9.334 s) : 0, 9334217
section iast_TELEMETRY_OFF
Agent [baseline] (1.143 s) : 0, 1142957
Total [baseline] (9.277 s) : 0, 9277406
Agent [candidate] (1.144 s) : 0, 1143699
Total [candidate] (9.318 s) : 0, 9317669
gantt
title insecure-bank - break down per module: candidate=1.23.0-SNAPSHOT~ef53842d04, baseline=1.23.0-SNAPSHOT~20a70a4bbf
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (647.965 ms) : 0, 647965
BytebuddyAgent [candidate] (645.736 ms) : 0, 645736
GlobalTracer [baseline] (293.561 ms) : 0, 293561
GlobalTracer [candidate] (294.14 ms) : 0, 294140
AppSec [baseline] (49.141 ms) : 0, 49141
AppSec [candidate] (48.971 ms) : 0, 48971
Remote Config [baseline] (695.025 µs) : 0, 695
Remote Config [candidate] (703.113 µs) : 0, 703
Telemetry [baseline] (11.282 ms) : 0, 11282
Telemetry [candidate] (11.299 ms) : 0, 11299
section iast
BytebuddyAgent [baseline] (763.243 ms) : 0, 763243
BytebuddyAgent [candidate] (771.994 ms) : 0, 771994
GlobalTracer [baseline] (273.063 ms) : 0, 273063
GlobalTracer [candidate] (273.957 ms) : 0, 273957
AppSec [baseline] (46.502 ms) : 0, 46502
AppSec [candidate] (46.818 ms) : 0, 46818
Remote Config [baseline] (565.876 µs) : 0, 566
Remote Config [candidate] (569.969 µs) : 0, 570
Telemetry [baseline] (11.689 ms) : 0, 11689
Telemetry [candidate] (13.187 ms) : 0, 13187
IAST [baseline] (17.766 ms) : 0, 17766
IAST [candidate] (17.097 ms) : 0, 17097
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (758.553 ms) : 0, 758553
BytebuddyAgent [candidate] (758.189 ms) : 0, 758189
GlobalTracer [baseline] (274.058 ms) : 0, 274058
GlobalTracer [candidate] (274.744 ms) : 0, 274744
AppSec [baseline] (46.406 ms) : 0, 46406
AppSec [candidate] (46.674 ms) : 0, 46674
Remote Config [baseline] (556.891 µs) : 0, 557
Remote Config [candidate] (569.886 µs) : 0, 570
Telemetry [baseline] (12.601 ms) : 0, 12601
Telemetry [candidate] (12.818 ms) : 0, 12818
IAST [baseline] (16.381 ms) : 0, 16381
IAST [candidate] (16.245 ms) : 0, 16245
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 22 cases. Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.23.0-SNAPSHOT~ef53842d04, baseline=1.23.0-SNAPSHOT~20a70a4bbf
dateFormat X
axisFormat %s
section baseline
no_agent (1.367 ms) : 1348, 1385
. : milestone, 1367,
appsec (1.749 ms) : 1725, 1774
. : milestone, 1749,
iast (1.491 ms) : 1466, 1515
. : milestone, 1491,
profiling (1.463 ms) : 1438, 1488
. : milestone, 1463,
tracing (1.448 ms) : 1424, 1472
. : milestone, 1448,
section candidate
no_agent (1.355 ms) : 1336, 1374
. : milestone, 1355,
appsec (1.713 ms) : 1688, 1738
. : milestone, 1713,
iast (1.483 ms) : 1459, 1506
. : milestone, 1483,
profiling (1.462 ms) : 1437, 1488
. : milestone, 1462,
tracing (1.453 ms) : 1429, 1478
. : milestone, 1453,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.23.0-SNAPSHOT~ef53842d04, baseline=1.23.0-SNAPSHOT~20a70a4bbf
dateFormat X
axisFormat %s
section baseline
no_agent (363.682 µs) : 344, 384
. : milestone, 364,
iast (461.703 µs) : 441, 482
. : milestone, 462,
iast_FULL (530.542 µs) : 510, 551
. : milestone, 531,
iast_INACTIVE (437.743 µs) : 417, 459
. : milestone, 438,
iast_TELEMETRY_OFF (462.736 µs) : 441, 484
. : milestone, 463,
tracing (440.161 µs) : 419, 461
. : milestone, 440,
section candidate
no_agent (361.439 µs) : 341, 382
. : milestone, 361,
iast (467.958 µs) : 447, 489
. : milestone, 468,
iast_FULL (519.105 µs) : 498, 540
. : milestone, 519,
iast_INACTIVE (446.516 µs) : 425, 468
. : milestone, 447,
iast_TELEMETRY_OFF (465.947 µs) : 444, 487
. : milestone, 466,
tracing (436.973 µs) : 416, 458
. : milestone, 437,
|
@@ -6,6 +6,10 @@ public enum MethodLocation { | |||
EXIT; | |||
|
|||
public static boolean isSame(MethodLocation methodLocation, MethodLocation evaluateAt) { | |||
if (methodLocation == MethodLocation.DEFAULT) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we do this only for line probe. maybe the line probe logic should not call this instead of adding this case in the method?
Aka, the evaluate function should already have the probe definition, right? so that function can simply skip this if the probe location does not need to check method location
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it centralizes the logic for both calls:
LogStatus logStatus = (LogStatus) status;
if (!hasCondition()) {
// sample when no condition associated
sample(logStatus, methodLocation);
}
logStatus.setCondition(evaluateCondition(context, logStatus));
CapturedContext.CapturedThrowable throwable = context.getThrowable();
if (logStatus.hasConditionErrors() && throwable != null) {
logStatus.addError(
new EvaluationError(
"uncaught exception", throwable.getType() + ": " + throwable.getMessage()));
}
if (hasCondition() && logStatus.getCondition()) {
// sample if probe has condition and condition is true
sample(logStatus, methodLocation);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually it's better to centralize also the other isSame call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would explain this in the comment. that MethodLocation.DEFAULT is used to mark that this is a line probe and therefore we don't check the probeLocation as it meaningless.
What Does This Do
In the case of a line probe MethodLocation is DEFAULT and we should not consider the evaluteAt attribute as it is meant for method probe only
Motivation
no sampling for line probe without condition
Additional Notes
Jira ticket: DEBUG-1908