Website: machine estimator v3.1 — bar never below an 8 GB box; a single leftover app keeps its name (R-997)
gates / gates (push) Successful in 6m47s
gates / gates (push) Successful in 6m47s
Empty or tiny selections drew a ~2.3 GB box whose base system (1,636 MB) no real box has; the bar is now floored at the smallest named size (8 GB) for its parts only — the recommendation and the rule are unchanged. Grouping applies only to two or more leftover apps; a ninth app is shown by name in the group's colour. Tests: 12, the new ones red-proofed.
This commit is contained in:
@@ -15,6 +15,8 @@
|
||||
* v3: the bar is split into what that box memory is used for, every part from the same rule:
|
||||
* base system = box - guest(box) · Felhom = platform · each app = its peak · spare = guest(box) - peak
|
||||
* so the parts add up to the box exactly (scripts/test_build_sizing_web.py proves it).
|
||||
* v3.1: the bar is never drawn for a box smaller than the smallest size the page names (boxes_gb[0]);
|
||||
* below it, the installer's ceiling clause would show a base system no real box has.
|
||||
*
|
||||
* The page text is not here: each page carries its own strings (#sizer-strings), so this file is the
|
||||
* same for both languages.
|
||||
@@ -68,7 +70,8 @@
|
||||
});
|
||||
var heavy = busy.filter(function (a) { return a.cpu_class === 'heavy-in-bursts'; });
|
||||
var wellGb = minBoxGb(data, peak * data.headroom);
|
||||
var boxMb = wellGb * 1024, guestMb = guestMib(data, wellGb);
|
||||
var barGb = Math.max(wellGb, data.boxes_gb[0]);
|
||||
var boxMb = barGb * 1024, guestMb = guestMib(data, barGb);
|
||||
var apps = slugs.map(function (s) { return bySlug[s]; })
|
||||
.filter(function (a) { return a && !a.builtin; })
|
||||
.sort(function (x, y) { return y.peak_mb - x.peak_mb; });
|
||||
@@ -77,7 +80,7 @@
|
||||
segments.push({ kind: 'spare', mb: guestMb - peak });
|
||||
return {
|
||||
typical_mb: typical, peak_mb: peak, boxes: boxes, busy: busy, heavy: heavy, unmeasured: unmeasured,
|
||||
well_gb: wellGb, tight_gb: minBoxGb(data, peak),
|
||||
well_gb: wellGb, bar_gb: barGb, tight_gb: minBoxGb(data, peak),
|
||||
recommend_gb: recommend, tight_box_gb: tightBox,
|
||||
segments: segments, base_mb: boxMb - guestMb, apps_peak_mb: peak - data.platform_mb
|
||||
};
|
||||
@@ -181,13 +184,21 @@
|
||||
|
||||
// the bar: its length is the "fits well" box memory, split into what that memory is used for
|
||||
// (estimate().segments); beyond the colour count the smallest apps join one segment
|
||||
var basis = Math.max(r.well_gb, max) * 1024;
|
||||
var basis = Math.max(r.bar_gb, max) * 1024;
|
||||
var segs = [], rest = { kind: 'more', mb: 0, n: 0 }, nApps = 0;
|
||||
var appCount = r.segments.filter(function (sg) { return sg.kind === 'app'; }).length;
|
||||
// group the smallest only when TWO or more are left over; a single leftover keeps its name
|
||||
// (in the group's colour — no ninth palette colour)
|
||||
var group = appCount - data.bar_app_colours >= 2;
|
||||
r.segments.forEach(function (sg) {
|
||||
if (sg.kind === 'app') {
|
||||
nApps += 1;
|
||||
if (nApps > data.bar_app_colours) { rest.mb += sg.mb; rest.n += 1; return; }
|
||||
sg.colour = 'sizer-c' + nApps;
|
||||
if (nApps > data.bar_app_colours) {
|
||||
if (group) { rest.mb += sg.mb; rest.n += 1; return; }
|
||||
sg.colour = 'sizer-seg-more';
|
||||
} else {
|
||||
sg.colour = 'sizer-c' + nApps;
|
||||
}
|
||||
}
|
||||
if (sg.kind === 'spare' && rest.n) { segs.push(rest); }
|
||||
segs.push(sg);
|
||||
|
||||
Reference in New Issue
Block a user