-
Notifications
You must be signed in to change notification settings - Fork 293
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 tracer logging when instrumenting Gradle Daemon #6080
Fix tracer logging when instrumenting Gradle Daemon #6080
Conversation
BenchmarksStartupParameters
See matching parameters
SummaryFound 1 performance improvements and 0 performance regressions! Performance is the same for 53 cases.
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.22.0-SNAPSHOT~3407cf2fba, baseline=1.22.0-SNAPSHOT~9a80d519df
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.012 s) : 0, 1012152
Total [baseline] (9.212 s) : 0, 9211891
Agent [candidate] (1.017 s) : 0, 1017287
Total [candidate] (9.286 s) : 0, 9286307
section appsec
Agent [baseline] (1.103 s) : 0, 1102612
Total [baseline] (9.287 s) : 0, 9286669
Agent [candidate] (1.103 s) : 0, 1103438
Total [candidate] (9.332 s) : 0, 9331838
section iast
Agent [baseline] (1.155 s) : 0, 1155483
Total [baseline] (9.504 s) : 0, 9503806
Agent [candidate] (1.145 s) : 0, 1144925
Total [candidate] (9.431 s) : 0, 9430687
section profiling
Agent [baseline] (1.2 s) : 0, 1199778
Total [baseline] (9.476 s) : 0, 9475593
Agent [candidate] (1.197 s) : 0, 1196567
Total [candidate] (9.601 s) : 0, 9600729
gantt
title petclinic - break down per module: candidate=1.22.0-SNAPSHOT~3407cf2fba, baseline=1.22.0-SNAPSHOT~9a80d519df
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (630.889 ms) : 0, 630889
BytebuddyAgent [candidate] (633.733 ms) : 0, 633733
GlobalTracer [baseline] (291.653 ms) : 0, 291653
GlobalTracer [candidate] (293.375 ms) : 0, 293375
AppSec [baseline] (48.711 ms) : 0, 48711
AppSec [candidate] (49.129 ms) : 0, 49129
Remote Config [baseline] (654.958 µs) : 0, 655
Remote Config [candidate] (661.196 µs) : 0, 661
Telemetry [baseline] (5.983 ms) : 0, 5983
Telemetry [candidate] (6.03 ms) : 0, 6030
section appsec
BytebuddyAgent [baseline] (632.649 ms) : 0, 632649
BytebuddyAgent [candidate] (632.851 ms) : 0, 632851
GlobalTracer [baseline] (291.848 ms) : 0, 291848
GlobalTracer [candidate] (292.348 ms) : 0, 292348
AppSec [baseline] (137.508 ms) : 0, 137508
AppSec [candidate] (137.706 ms) : 0, 137706
Remote Config [baseline] (638.573 µs) : 0, 639
Remote Config [candidate] (639.542 µs) : 0, 640
Telemetry [baseline] (5.685 ms) : 0, 5685
Telemetry [candidate] (5.703 ms) : 0, 5703
section iast
BytebuddyAgent [baseline] (771.709 ms) : 0, 771709
BytebuddyAgent [candidate] (763.478 ms) : 0, 763478
GlobalTracer [baseline] (276.09 ms) : 0, 276090
GlobalTracer [candidate] (273.41 ms) : 0, 273410
AppSec [baseline] (47.055 ms) : 0, 47055
AppSec [candidate] (46.558 ms) : 0, 46558
Remote Config [baseline] (592.135 µs) : 0, 592
Remote Config [candidate] (587.365 µs) : 0, 587
Telemetry [baseline] (7.694 ms) : 0, 7694
Telemetry [candidate] (7.597 ms) : 0, 7597
IAST [baseline] (17.612 ms) : 0, 17612
IAST [candidate] (18.926 ms) : 0, 18926
section profiling
ProfilingAgent [baseline] (81.065 ms) : 0, 81065
ProfilingAgent [candidate] (81.09 ms) : 0, 81090
BytebuddyAgent [baseline] (651.4 ms) : 0, 651400
BytebuddyAgent [candidate] (648.291 ms) : 0, 648291
GlobalTracer [baseline] (357.213 ms) : 0, 357213
GlobalTracer [candidate] (357.278 ms) : 0, 357278
AppSec [baseline] (49.324 ms) : 0, 49324
AppSec [candidate] (49.485 ms) : 0, 49485
Remote Config [baseline] (662.323 µs) : 0, 662
Remote Config [candidate] (672.789 µs) : 0, 673
Telemetry [baseline] (6.096 ms) : 0, 6096
Telemetry [candidate] (6.129 ms) : 0, 6129
Profiling [baseline] (81.091 ms) : 0, 81091
Profiling [candidate] (81.114 ms) : 0, 81114
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.22.0-SNAPSHOT~3407cf2fba, baseline=1.22.0-SNAPSHOT~9a80d519df
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.012 s) : 0, 1012289
Total [baseline] (8.692 s) : 0, 8691975
Agent [candidate] (1.023 s) : 0, 1022517
Total [candidate] (8.714 s) : 0, 8714106
section iast
Agent [baseline] (1.156 s) : 0, 1155839
Total [baseline] (9.313 s) : 0, 9313305
Agent [candidate] (1.14 s) : 0, 1139826
Total [candidate] (9.226 s) : 0, 9226262
section iast_TELEMETRY_OFF
Agent [baseline] (1.143 s) : 0, 1142726
Total [baseline] (9.233 s) : 0, 9233340
Agent [candidate] (1.132 s) : 0, 1131816
Total [candidate] (9.197 s) : 0, 9197299
gantt
title insecure-bank - break down per module: candidate=1.22.0-SNAPSHOT~3407cf2fba, baseline=1.22.0-SNAPSHOT~9a80d519df
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (630.914 ms) : 0, 630914
BytebuddyAgent [candidate] (636.979 ms) : 0, 636979
GlobalTracer [baseline] (291.566 ms) : 0, 291566
GlobalTracer [candidate] (294.653 ms) : 0, 294653
AppSec [baseline] (48.943 ms) : 0, 48943
AppSec [candidate] (49.55 ms) : 0, 49550
Remote Config [baseline] (660.656 µs) : 0, 661
Remote Config [candidate] (666.805 µs) : 0, 667
Telemetry [baseline] (5.944 ms) : 0, 5944
Telemetry [candidate] (6.065 ms) : 0, 6065
section iast
BytebuddyAgent [baseline] (772.275 ms) : 0, 772275
BytebuddyAgent [candidate] (760.785 ms) : 0, 760785
GlobalTracer [baseline] (275.657 ms) : 0, 275657
GlobalTracer [candidate] (272.595 ms) : 0, 272595
AppSec [baseline] (46.645 ms) : 0, 46645
AppSec [candidate] (45.944 ms) : 0, 45944
IAST [baseline] (17.641 ms) : 0, 17641
IAST [candidate] (20.184 ms) : 0, 20184
Remote Config [baseline] (572.103 µs) : 0, 572
Remote Config [candidate] (582.984 µs) : 0, 583
Telemetry [baseline] (8.291 ms) : 0, 8291
Telemetry [candidate] (5.49 ms) : 0, 5490
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (761.322 ms) : 0, 761322
BytebuddyAgent [candidate] (753.939 ms) : 0, 753939
GlobalTracer [baseline] (274.953 ms) : 0, 274953
GlobalTracer [candidate] (272.742 ms) : 0, 272742
AppSec [baseline] (46.486 ms) : 0, 46486
AppSec [candidate] (46.356 ms) : 0, 46356
IAST [baseline] (17.116 ms) : 0, 17116
IAST [candidate] (17.069 ms) : 0, 17069
Remote Config [baseline] (583.449 µs) : 0, 583
Remote Config [candidate] (582.988 µs) : 0, 583
Telemetry [baseline] (7.677 ms) : 0, 7677
Telemetry [candidate] (6.926 ms) : 0, 6926
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.22.0-SNAPSHOT~3407cf2fba, baseline=1.22.0-SNAPSHOT~9a80d519df
dateFormat X
axisFormat %s
section baseline
no_agent (1.343 ms) : 1324, 1362
. : milestone, 1343,
appsec (1.694 ms) : 1669, 1718
. : milestone, 1694,
iast (1.453 ms) : 1429, 1477
. : milestone, 1453,
profiling (1.46 ms) : 1436, 1485
. : milestone, 1460,
tracing (1.45 ms) : 1426, 1475
. : milestone, 1450,
section candidate
no_agent (1.33 ms) : 1311, 1349
. : milestone, 1330,
appsec (1.699 ms) : 1675, 1724
. : milestone, 1699,
iast (1.447 ms) : 1423, 1472
. : milestone, 1447,
profiling (1.456 ms) : 1432, 1481
. : milestone, 1456,
tracing (1.441 ms) : 1416, 1466
. : milestone, 1441,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.22.0-SNAPSHOT~3407cf2fba, baseline=1.22.0-SNAPSHOT~9a80d519df
dateFormat X
axisFormat %s
section baseline
no_agent (370.876 µs) : 350, 392
. : milestone, 371,
iast (465.558 µs) : 445, 486
. : milestone, 466,
iast_FULL (526.192 µs) : 506, 547
. : milestone, 526,
iast_INACTIVE (432.019 µs) : 411, 453
. : milestone, 432,
iast_TELEMETRY_OFF (463.849 µs) : 443, 485
. : milestone, 464,
tracing (433.56 µs) : 412, 455
. : milestone, 434,
section candidate
no_agent (364.431 µs) : 344, 385
. : milestone, 364,
iast (465.361 µs) : 444, 487
. : milestone, 465,
iast_FULL (524.278 µs) : 504, 545
. : milestone, 524,
iast_INACTIVE (431.121 µs) : 411, 451
. : milestone, 431,
iast_TELEMETRY_OFF (456.682 µs) : 436, 477
. : milestone, 457,
tracing (437.081 µs) : 416, 458
. : milestone, 437,
|
|
||
public interface Resettable { | ||
void reset(); | ||
} |
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've added @bantonsson as he knows more about our embedded logger, but I wonder if it makes sense to add such a generic API for such a specific use.
You could instead add a method such as initialize
or reset
to LogLevelSwitcher
and then use the existing GlobalLogLevelSwitcher
to drive the reset of DDLoggerFactory
. Alternatively you could create a new log-specific interface if you prefer it to be separate from LogLevelSwitcher
, but follow a similar pattern.
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.
Good point, I completely overlooked the LogLevelSwitcher
interface. Added a new method there instead of Resettable
.
… Resettable interface
What Does This Do
Fixes tracer logging to work when instrumenting Gradle Daemon.
Motivation
Tracer logs contain data that is important for debugging.
When Gradle Daemon initialises, it closes original
System.out
andSystem.err
streams, replacing them with daemon log streams.Tracer logging is initialised before the daemon, so it refers to the original streams that are closed.
In order for the logging to work, it needs to refer to the daemon log streams.
This is achieved by reinitialising logging settings after Gradle Daemon has finished its initialisation.
Jira ticket: CIVIS-7730