@vincemakes/kiso-tui 0.1.42 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/render.js +7 -2
- package/package.json +2 -2
package/dist/render.js
CHANGED
|
@@ -181,8 +181,13 @@ export function renderRecap(s) {
|
|
|
181
181
|
const seg = `${s.usage.in !== null ? `in ${kUnit(s.usage.in)}` : ""}${s.usage.in !== null && s.usage.out !== null ? " " : ""}${s.usage.out !== null ? `out ${kUnit(s.usage.out)}` : ""}`;
|
|
182
182
|
if (seg !== "")
|
|
183
183
|
parts.push(seg);
|
|
184
|
-
if (s.usage.cache !== null && s.usage.in !== null && s.usage.in > 0) {
|
|
185
|
-
|
|
184
|
+
if (s.usage.cache !== null && s.usage.in !== null && (s.usage.in > 0 || s.usage.cache > 0)) {
|
|
185
|
+
// E2 (1.3.0, T5): the cache % divides by the TOTAL (in + cache) —
|
|
186
|
+
// the pinned sentence: cacheRead/total can never exceed 100%. The
|
|
187
|
+
// old cache/in denominator rendered 923% for fresh 111 + cache
|
|
188
|
+
// 1024 (the >100% disease the canonical schema cures). in 0 with
|
|
189
|
+
// cache > 0 is honest: everything came from cache → 100%.
|
|
190
|
+
const hit = `cache ${Math.round((s.usage.cache / (s.usage.in + s.usage.cache)) * 100)}%`;
|
|
186
191
|
parts.push(s.missed !== undefined && s.missed > 0 ? `${hit} · miss ${kUnit(s.missed)}` : hit);
|
|
187
192
|
}
|
|
188
193
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vincemakes/kiso-tui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "kiso tui — the pure terminal layer (cell renderer, dock, raw editor, diff, palette). Zero runtime dependencies: input is data, output is bytes.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,6 +35,6 @@
|
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://github.com/vincemakes/kiso/tree/main/packages/tui#readme",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@vincemakes/kiso-tui-cells": "0.
|
|
38
|
+
"@vincemakes/kiso-tui-cells": "0.2.0"
|
|
39
39
|
}
|
|
40
40
|
}
|