[PERF] Runtime Introspection Syscalls
This commit is contained in:
@@ -294,6 +294,8 @@ impl HostDebugger {
|
||||
glyph_slots_total: telemetry.glyph_slots_total,
|
||||
sound_slots_used: telemetry.sound_slots_used,
|
||||
sound_slots_total: telemetry.sound_slots_total,
|
||||
scene_slots_used: telemetry.scene_slots_used,
|
||||
scene_slots_total: telemetry.scene_slots_total,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -94,6 +94,7 @@ pub(crate) fn capture_snapshot(stats: &HostStats, firmware: &Firmware) -> Overla
|
||||
let heap_ratio = ratio(tel.heap_used_bytes as u64, heap_total_bytes as u64);
|
||||
let glyph_ratio = ratio(tel.glyph_slots_used as u64, tel.glyph_slots_total as u64);
|
||||
let sound_ratio = ratio(tel.sound_slots_used as u64, tel.sound_slots_total as u64);
|
||||
let scene_ratio = ratio(tel.scene_slots_used as u64, tel.scene_slots_total as u64);
|
||||
|
||||
OverlaySnapshot {
|
||||
rows: vec![
|
||||
@@ -163,6 +164,12 @@ pub(crate) fn capture_snapshot(stats: &HostStats, firmware: &Firmware) -> Overla
|
||||
ratio: sound_ratio,
|
||||
warn: tel.sound_slots_total > 0 && tel.sound_slots_used >= tel.sound_slots_total,
|
||||
},
|
||||
OverlayBar {
|
||||
label: "SCENE",
|
||||
value: format!("{} / {} slots", tel.scene_slots_used, tel.scene_slots_total),
|
||||
ratio: scene_ratio,
|
||||
warn: tel.scene_slots_total > 0 && tel.scene_slots_used >= tel.scene_slots_total,
|
||||
},
|
||||
],
|
||||
footer,
|
||||
}
|
||||
|
||||
@@ -387,6 +387,8 @@ mod tests {
|
||||
glyph_slots_total: 16,
|
||||
sound_slots_used: 0,
|
||||
sound_slots_total: 8,
|
||||
scene_slots_used: 2,
|
||||
scene_slots_total: 16,
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
@@ -403,6 +405,8 @@ mod tests {
|
||||
glyph_slots_total,
|
||||
sound_slots_used,
|
||||
sound_slots_total,
|
||||
scene_slots_used,
|
||||
scene_slots_total,
|
||||
} => {
|
||||
assert_eq!(frame_index, 8);
|
||||
assert_eq!(vm_steps, 123);
|
||||
@@ -415,6 +419,8 @@ mod tests {
|
||||
assert_eq!(glyph_slots_total, 16);
|
||||
assert_eq!(sound_slots_used, 0);
|
||||
assert_eq!(sound_slots_total, 8);
|
||||
assert_eq!(scene_slots_used, 2);
|
||||
assert_eq!(scene_slots_total, 16);
|
||||
}
|
||||
other => panic!("unexpected telemetry event: {:?}", other),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user