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 {
9191 testImplementation project(' :remote-config:remote-config-core' )
9292 testImplementation group : ' org.msgpack' , name : ' msgpack-core' , version : ' 0.8.20'
9393 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 '
9595 testImplementation group : ' commons-codec' , name : ' commons-codec' , version : ' 1.3'
9696 testImplementation group : ' com.amazonaws' , name : ' aws-lambda-java-events' , version :' 3.11.0'
9797 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 {
3737 1000 ,
3838 1000 ,
3939 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)
4244 aggregator. start()
4345
4446 when : " lots of traces are published"
@@ -72,7 +74,8 @@ class FootprintForkedTest extends DDSpecification {
7274 assert latch. await(30 , SECONDS )
7375
7476 then :
75- footprint(aggregator) - baseline <= 10 * 1024 * 1024
77+ def layout = footprint(aggregator, features). subtract(baseline)
78+ layout. totalSize() - baseline. totalSize() <= 10 * 1024 * 1024
7679
7780 cleanup :
7881 aggregator. close()
@@ -136,9 +139,14 @@ class FootprintForkedTest extends DDSpecification {
136139 }
137140
138141
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
143151 }
144152}
You can’t perform that action at this time.
0 commit comments