summaryrefslogtreecommitdiff
path: root/source/util/Diag.mc
diff options
context:
space:
mode:
authorcirakg <cirakg@cirakg.xyz>2026-10-20 01:51:05 +0200
committercirakg <cirakg@cirakg.xyz>2026-10-20 01:51:05 +0200
commitd537f4e154a40075405b0ab2fed14fbe2eeaac81 (patch)
treef1fb9b148871901dda96fca11401d6f4d0ee1d59 /source/util/Diag.mc
parent40d9a1d5c3e85486aea964c1446402a3be6ec05a (diff)
feat(settings): apply the Import form from the phone and show results
Import group in the app settings; the processor runs after the first frame and on settings changes, clears the fields, writes the status, remembers form hashes and opens the results screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'source/util/Diag.mc')
-rw-r--r--source/util/Diag.mc27
1 files changed, 27 insertions, 0 deletions
diff --git a/source/util/Diag.mc b/source/util/Diag.mc
index a09d3f8..0ab121f 100644
--- a/source/util/Diag.mc
+++ b/source/util/Diag.mc
@@ -96,4 +96,31 @@ module Diag {
(:release)
function overlay(dc as Graphics.Dc, frameStartMs as Number) as Void {
}
+
+ // Peak memory while long work runs (sampled by the import job).
+ (:debug)
+ var peakMemory as Number = 0;
+
+ (:debug)
+ function sampleMemory() as Void {
+ var used = System.getSystemStats().usedMemory;
+ if (used > peakMemory) {
+ peakMemory = used;
+ }
+ }
+
+ (:release)
+ function sampleMemory() as Void {
+ }
+
+ // Reports an import's size, duration and peak memory for UI scripts.
+ (:debug)
+ function importDone(entries as Number, wallMs as Number) as Void {
+ System.println("DIAG import entries=" + entries + " wall_ms=" + wallMs + " mem_peak=" + peakMemory
+ + " mem_total=" + System.getSystemStats().totalMemory);
+ }
+
+ (:release)
+ function importDone(entries as Number, wallMs as Number) as Void {
+ }
}