feat: add STEP-093 runtime validation tooling
This commit is contained in:
@@ -729,7 +729,7 @@ jni::jboolean NativeMapView::setContinuousLayerRange(JNIEnv& env,
|
||||
|
||||
jni::Local<jni::Array<jni::String>> NativeMapView::getRetainedUnderlayDiagnostics(JNIEnv& env) {
|
||||
const auto snapshot = map->getRetainedUnderlayDiagnostics();
|
||||
const std::array<std::string, 20> values = {
|
||||
const std::array<std::string, 39> values = {
|
||||
snapshot.enabled ? "true" : "false",
|
||||
std::to_string(snapshot.build),
|
||||
std::to_string(snapshot.reuse),
|
||||
@@ -742,14 +742,33 @@ jni::Local<jni::Array<jni::String>> NativeMapView::getRetainedUnderlayDiagnostic
|
||||
snapshot.endLayerId,
|
||||
std::to_string(snapshot.startIndex),
|
||||
std::to_string(snapshot.endIndex),
|
||||
std::to_string(snapshot.continuousBegin),
|
||||
std::to_string(snapshot.continuousEndExclusive),
|
||||
snapshot.bottomPresent ? "true" : "false",
|
||||
snapshot.bottomCacheState,
|
||||
std::to_string(snapshot.bottomBuild),
|
||||
std::to_string(snapshot.bottomReuse),
|
||||
std::to_string(snapshot.bottomInvalidation),
|
||||
snapshot.bottomLastInvalidationReason,
|
||||
std::to_string(snapshot.bottomTextureCreate),
|
||||
std::to_string(snapshot.bottomCompositeCreate),
|
||||
std::to_string(snapshot.bottomResourceRelease),
|
||||
snapshot.topPresent ? "true" : "false",
|
||||
snapshot.topCacheState,
|
||||
std::to_string(snapshot.topBuild),
|
||||
std::to_string(snapshot.topReuse),
|
||||
std::to_string(snapshot.topInvalidation),
|
||||
snapshot.topLastInvalidationReason,
|
||||
std::to_string(snapshot.topTextureCreate),
|
||||
std::to_string(snapshot.topCompositeCreate),
|
||||
std::to_string(snapshot.topResourceRelease),
|
||||
snapshot.rangeFallback ? "true" : "false",
|
||||
snapshot.fastPathEligible ? "true" : "false",
|
||||
snapshot.fastPathActive ? "true" : "false",
|
||||
snapshot.fastPathFallbackReason,
|
||||
std::to_string(snapshot.fastPathHit),
|
||||
std::to_string(snapshot.fastPathMiss),
|
||||
std::to_string(snapshot.fullCpuFrame),
|
||||
};
|
||||
auto result = jni::Array<jni::String>::New(env, values.size());
|
||||
for (std::size_t index = 0; index < values.size(); ++index) {
|
||||
|
||||
@@ -18,18 +18,37 @@ public final class RetainedUnderlayDiagnostics {
|
||||
@NonNull public final String endLayerId;
|
||||
public final int startIndex;
|
||||
public final int endIndex;
|
||||
public final int continuousBegin;
|
||||
public final int continuousEndExclusive;
|
||||
public final boolean bottomPresent;
|
||||
@NonNull public final String bottomCacheState;
|
||||
public final long bottomBuild;
|
||||
public final long bottomReuse;
|
||||
public final long bottomInvalidation;
|
||||
@NonNull public final String bottomLastInvalidationReason;
|
||||
public final long bottomTextureCreate;
|
||||
public final long bottomCompositeCreate;
|
||||
public final long bottomResourceRelease;
|
||||
public final boolean topPresent;
|
||||
@NonNull public final String topCacheState;
|
||||
public final long topBuild;
|
||||
public final long topReuse;
|
||||
public final long topInvalidation;
|
||||
@NonNull public final String topLastInvalidationReason;
|
||||
public final long topTextureCreate;
|
||||
public final long topCompositeCreate;
|
||||
public final long topResourceRelease;
|
||||
public final boolean rangeFallback;
|
||||
public final boolean fastPathEligible;
|
||||
public final boolean fastPathActive;
|
||||
@NonNull public final String fastPathFallbackReason;
|
||||
public final long fastPathHit;
|
||||
public final long fastPathMiss;
|
||||
public final long fullCpuFrame;
|
||||
|
||||
RetainedUnderlayDiagnostics(@NonNull String[] values) {
|
||||
if (values.length != 20) {
|
||||
throw new IllegalArgumentException("Retained-range diagnostics require 20 values");
|
||||
if (values.length != 39) {
|
||||
throw new IllegalArgumentException("Retained-range diagnostics require 39 values");
|
||||
}
|
||||
enabled = Boolean.parseBoolean(values[0]);
|
||||
build = Long.parseLong(values[1]);
|
||||
@@ -43,20 +62,41 @@ public final class RetainedUnderlayDiagnostics {
|
||||
endLayerId = values[9];
|
||||
startIndex = Integer.parseInt(values[10]);
|
||||
endIndex = Integer.parseInt(values[11]);
|
||||
bottomPresent = Boolean.parseBoolean(values[12]);
|
||||
bottomBuild = Long.parseLong(values[13]);
|
||||
bottomReuse = Long.parseLong(values[14]);
|
||||
bottomInvalidation = Long.parseLong(values[15]);
|
||||
topPresent = Boolean.parseBoolean(values[16]);
|
||||
topBuild = Long.parseLong(values[17]);
|
||||
topReuse = Long.parseLong(values[18]);
|
||||
topInvalidation = Long.parseLong(values[19]);
|
||||
continuousBegin = Integer.parseInt(values[12]);
|
||||
continuousEndExclusive = Integer.parseInt(values[13]);
|
||||
bottomPresent = Boolean.parseBoolean(values[14]);
|
||||
bottomCacheState = values[15];
|
||||
bottomBuild = Long.parseLong(values[16]);
|
||||
bottomReuse = Long.parseLong(values[17]);
|
||||
bottomInvalidation = Long.parseLong(values[18]);
|
||||
bottomLastInvalidationReason = values[19];
|
||||
bottomTextureCreate = Long.parseLong(values[20]);
|
||||
bottomCompositeCreate = Long.parseLong(values[21]);
|
||||
bottomResourceRelease = Long.parseLong(values[22]);
|
||||
topPresent = Boolean.parseBoolean(values[23]);
|
||||
topCacheState = values[24];
|
||||
topBuild = Long.parseLong(values[25]);
|
||||
topReuse = Long.parseLong(values[26]);
|
||||
topInvalidation = Long.parseLong(values[27]);
|
||||
topLastInvalidationReason = values[28];
|
||||
topTextureCreate = Long.parseLong(values[29]);
|
||||
topCompositeCreate = Long.parseLong(values[30]);
|
||||
topResourceRelease = Long.parseLong(values[31]);
|
||||
rangeFallback = Boolean.parseBoolean(values[32]);
|
||||
fastPathEligible = Boolean.parseBoolean(values[33]);
|
||||
fastPathActive = Boolean.parseBoolean(values[34]);
|
||||
fastPathFallbackReason = values[35];
|
||||
fastPathHit = Long.parseLong(values[36]);
|
||||
fastPathMiss = Long.parseLong(values[37]);
|
||||
fullCpuFrame = Long.parseLong(values[38]);
|
||||
}
|
||||
|
||||
static RetainedUnderlayDiagnostics unavailable() {
|
||||
return new RetainedUnderlayDiagnostics(new String[] {
|
||||
"true", "0", "0", "0", "0", "unavailable", "false", "false", "", "", "-1", "-1",
|
||||
"false", "0", "0", "0", "false", "0", "0", "0"
|
||||
"-1", "-1", "false", "disabled", "0", "0", "0", "none", "0", "0", "0",
|
||||
"false", "disabled", "0", "0", "0", "none", "0", "0", "0", "false", "false",
|
||||
"false", "no-prepared-tree", "0", "0", "0"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user