forked from Blendman974/faceclaw
Add stats collection and first-run on-glasses onboarding app
This commit is contained in:
1 parent
84baee9c76
commit
406cefe0c5
73 files changed
+3906
-98
No files matched your search
@@ -0,0 +1,14 @@
|
||||
declare const com: any;
|
||||
|
||||
/**
|
||||
* Connection-reliability event counts since the last call, from the shared
|
||||
* Kotlin session core (ConnectionCounters.kt), which keeps them process-wide.
|
||||
*/
|
||||
export function drainConnectionCounters(): Record<string, number> {
|
||||
const counts: Record<string, number> = {};
|
||||
const parsed = JSON.parse(String(com.faceclaw.app.ConnectionCounters.drain())) as Record<string, unknown>;
|
||||
for (const [name, count] of Object.entries(parsed)) {
|
||||
if (typeof count === "number" && count > 0) counts[name] = count;
|
||||
}
|
||||
return counts;
|
||||
}
|
||||
Reference in new issue
Block a user