File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
dd-trace-core/src/test/groovy/datadog/trace/common/metrics Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -73,8 +73,8 @@ class FootprintForkedTest extends DDSpecification {
73
73
assert latch. await(30 , SECONDS )
74
74
75
75
then :
76
- def layout = footprint(aggregator, features)
77
- layout . totalSize() - baseline. totalSize() <= 10 * 1024 * 1024
76
+ def after = footprint(aggregator, features)
77
+ after - baseline <= 10 * 1024 * 1024
78
78
79
79
cleanup :
80
80
aggregator. close()
@@ -137,15 +137,17 @@ class FootprintForkedTest extends DDSpecification {
137
137
}
138
138
}
139
139
140
-
141
- static GraphLayout footprint (Object root , Object ... excludedRootFieldInstance ) {
140
+ static long footprint (Object root , Object ... excludedRootFieldInstance ) {
142
141
GraphLayout layout = GraphLayout . parseInstance(root)
142
+ def size = layout. totalSize()
143
143
144
144
excludedRootFieldInstance. each {
145
- layout = layout. subtract(GraphLayout . parseInstance(it))
145
+ def excludedLayout = GraphLayout . parseInstance(it)
146
+ layout = layout. subtract(excludedLayout)
147
+ size - = excludedLayout. totalSize()
146
148
}
147
149
148
- println layout. toFootprint()
149
- return layout
150
+ println ( layout. toFootprint() )
151
+ return size
150
152
}
151
153
}
You can’t perform that action at this time.
0 commit comments