File tree Expand file tree Collapse file tree 2 files changed +16
-8
lines changed
src/test/groovy/datadog/trace/common/metrics Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ dependencies {
91
91
testImplementation project(' :remote-config:remote-config-core' )
92
92
testImplementation group : ' org.msgpack' , name : ' msgpack-core' , version : ' 0.8.20'
93
93
testImplementation group : ' org.msgpack' , name : ' jackson-dataformat-msgpack' , version : ' 0.8.20'
94
- testImplementation group : ' org.openjdk.jol' , name : ' jol-core' , version : ' 0.16 '
94
+ testImplementation group : ' org.openjdk.jol' , name : ' jol-core' , version : ' 0.17 '
95
95
testImplementation group : ' commons-codec' , name : ' commons-codec' , version : ' 1.3'
96
96
testImplementation group : ' com.amazonaws' , name : ' aws-lambda-java-events' , version :' 3.11.0'
97
97
testImplementation group : ' com.google.protobuf' , name : ' protobuf-java' , version : ' 3.14.0'
Original file line number Diff line number Diff line change @@ -37,8 +37,10 @@ class FootprintForkedTest extends DDSpecification {
37
37
1000 ,
38
38
1000 ,
39
39
100 ,
40
- SECONDS )
41
- long baseline = footprint(aggregator)
40
+ SECONDS
41
+ )
42
+ // Removing the 'features' as it's a mock, and mocks are heavyweight
43
+ def baseline = footprint(aggregator, features)
42
44
aggregator. start()
43
45
44
46
when : " lots of traces are published"
@@ -72,7 +74,8 @@ class FootprintForkedTest extends DDSpecification {
72
74
assert latch. await(30 , SECONDS )
73
75
74
76
then :
75
- footprint(aggregator) - baseline <= 10 * 1024 * 1024
77
+ def layout = footprint(aggregator, features). subtract(baseline)
78
+ layout. totalSize() - baseline. totalSize() <= 10 * 1024 * 1024
76
79
77
80
cleanup :
78
81
aggregator. close()
@@ -136,9 +139,14 @@ class FootprintForkedTest extends DDSpecification {
136
139
}
137
140
138
141
139
- static long footprint (Object o ) {
140
- GraphLayout layout = GraphLayout . parseInstance(o)
141
- System . err. println (layout. toFootprint())
142
- return layout. totalSize()
142
+ static GraphLayout footprint (Object root , Object ... excludedRootFieldInstance ) {
143
+ GraphLayout layout = GraphLayout . parseInstance(root)
144
+
145
+ excludedRootFieldInstance. each {
146
+ layout = layout. subtract(GraphLayout . parseInstance(it))
147
+ }
148
+
149
+ println layout. toFootprint()
150
+ return layout
143
151
}
144
152
}
You can’t perform that action at this time.
0 commit comments