diff --git a/docs/reference-manual/native-image/assets/build-output-schema-v0.9.0.json b/docs/reference-manual/native-image/assets/build-output-schema-v0.9.0.json index 765d36de7f0e..510eb4226f04 100644 --- a/docs/reference-manual/native-image/assets/build-output-schema-v0.9.0.json +++ b/docs/reference-manual/native-image/assets/build-output-schema-v0.9.0.json @@ -279,6 +279,27 @@ "title": "The number of bytes used for debug info" } } + }, + "runtime_compiled_methods": { + "type": "object", + "default": {}, + "title": "Statistics on runtime compiled methods (optional)", + "required": [ + "count", + "graph_encoding_bytes" + ], + "properties": { + "count": { + "type": "integer", + "default": 0, + "title": "Number of runtime compiled methods" + }, + "graph_encoding_bytes": { + "type": "integer", + "default": 0, + "title": "The number of bytes used for graph encodings bytes" + } + } } }, "examples": [ @@ -494,6 +515,10 @@ "count": 134, "bytes": 10200 } + }, + "runtime_compiled_methods": { + "count": 12744, + "graph_encoding_bytes": 1440000 } }, "resource_usage": { diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ProgressReporter.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ProgressReporter.java index 02284d0531ae..7b99816c112d 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ProgressReporter.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ProgressReporter.java @@ -348,6 +348,7 @@ private void printAnalysisStatistics(AnalysisUniverse universe, Collection= 0) { + recordJsonMetric(ImageDetailKey.RUNTIME_COMPILED_METHODS_COUNT, numRuntimeCompiledMethods); l().a(actualVsTotalFormat, numRuntimeCompiledMethods, numRuntimeCompiledMethods / (double) totalMethods * 100, totalMethods) .a(" methods included for ").doclink("runtime compilation", "#glossary-runtime-methods").println(); } @@ -533,7 +534,8 @@ private void calculateHeapBreakdown(Collection heapObjects) { heapBreakdown.put(BREAKDOWN_BYTE_ARRAY_PREFIX + linkStrategy.asDocLink("embedded resources", "#glossary-embedded-resources"), resourcesByteLength); remainingBytes -= resourcesByteLength; } - if (graphEncodingByteLength > 0) { + if (graphEncodingByteLength >= 0) { + recordJsonMetric(ImageDetailKey.GRAPH_ENCODING_SIZE, graphEncodingByteLength); heapBreakdown.put(BREAKDOWN_BYTE_ARRAY_PREFIX + linkStrategy.asDocLink("graph encodings", "#glossary-graph-encodings"), graphEncodingByteLength); remainingBytes -= graphEncodingByteLength; } diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ProgressReporterJsonHelper.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ProgressReporterJsonHelper.java index 26a0a7ca49c4..53ccc9855236 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ProgressReporterJsonHelper.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ProgressReporterJsonHelper.java @@ -162,7 +162,9 @@ enum ImageDetailKey implements JsonMetric { IMAGE_HEAP_SIZE("image_heap", null, "bytes"), DEBUG_INFO_SIZE("debug_info", null, "bytes"), IMAGE_HEAP_RESOURCE_COUNT("image_heap", "resources", "count"), - RESOURCE_SIZE_BYTES("image_heap", "resources", "bytes"); + RESOURCE_SIZE_BYTES("image_heap", "resources", "bytes"), + RUNTIME_COMPILED_METHODS_COUNT("runtime_compiled_methods", null, "count"), + GRAPH_ENCODING_SIZE("runtime_compiled_methods", null, "graph_encoding_bytes"); private String bucket; private String key;