@impz/testing 6.9.0 → 6.9.1

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.
Files changed (2) hide show
  1. package/dist/index.js +8 -4
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -20210,6 +20210,7 @@ var SystemInfoSchema = z33.object({
20210
20210
  ramCommittedMib: z33.int().nonnegative(),
20211
20211
  ramPriorityKeptMib: z33.int().nonnegative().optional(),
20212
20212
  ramSleepingMib: z33.int().nonnegative().optional(),
20213
+ ramPrioritySleepingMib: z33.int().nonnegative().optional(),
20213
20214
  awakeCount: z33.int().nonnegative(),
20214
20215
  impCount: z33.int().nonnegative(),
20215
20216
  sessionCount: z33.int().nonnegative(),
@@ -21992,7 +21993,7 @@ import { join as join48 } from "path";
21992
21993
  // packages/daemon/package.json
21993
21994
  var package_default = {
21994
21995
  name: "@impz/daemon",
21995
- version: "6.9.0",
21996
+ version: "6.9.1",
21996
21997
  private: true,
21997
21998
  description: "impd: the imp host daemon",
21998
21999
  type: "module",
@@ -30559,7 +30560,7 @@ async function readSystemInfo(deps) {
30559
30560
  deps.images.findDefaultImage()
30560
30561
  ]);
30561
30562
  const running = imps.filter((imp) => imp.state === "running");
30562
- const sleeping = imps.filter((imp) => imp.state === "sleeping");
30563
+ const sleeping = imps.filter((imp) => imp.state === "sleeping" && !deps.governor.isAdmitted(imp.id));
30563
30564
  return {
30564
30565
  version: package_default.version,
30565
30566
  ramBudgetMib: deps.config.ramBudgetMib,
@@ -30568,6 +30569,7 @@ async function readSystemInfo(deps) {
30568
30569
  ramCommittedMib: running.reduce((sum, imp) => sum + imp.maxMemoryMib, 0),
30569
30570
  ramPriorityKeptMib: usage.priorityKeptMib,
30570
30571
  ramSleepingMib: sleeping.reduce((sum, imp) => sum + imp.memoryMib, 0),
30572
+ ramPrioritySleepingMib: sleeping.filter((imp) => deps.governor.isPriority(imp.name)).reduce((sum, imp) => sum + imp.memoryMib, 0),
30571
30573
  awakeCount: running.length,
30572
30574
  impCount: imps.length,
30573
30575
  sessionCount: imps.reduce((sum, imp) => sum + (deps.imps.countSessions(imp) ?? 0), 0),
@@ -37946,7 +37948,7 @@ function createRamGovernor(deps) {
37946
37948
  }
37947
37949
  emitAdmission(request, "admitted", usedMib);
37948
37950
  };
37949
- const readReservation = (id) => {
37951
+ const getReservationMib = (id) => {
37950
37952
  const reservation = reservations.get(id);
37951
37953
  if (reservation === undefined) {
37952
37954
  return 0;
@@ -37978,7 +37980,7 @@ function createRamGovernor(deps) {
37978
37980
  const readings = await Promise.all(awake.map((imp) => readVm(imp.pid, imp.apiSocket)));
37979
37981
  const live = [...reservations.keys()].filter((id) => id !== excludeId).map((id) => ({
37980
37982
  id,
37981
- mib: readReservation(id),
37983
+ mib: getReservationMib(id),
37982
37984
  isPriority: admittedPriority.has(id),
37983
37985
  isOnPool: pendingHugePages.has(id)
37984
37986
  }));
@@ -38206,6 +38208,8 @@ function createRamGovernor(deps) {
38206
38208
  reservations.set(id, reservation.beforeGrow);
38207
38209
  }
38208
38210
  },
38211
+ isPriority,
38212
+ isAdmitted: (id) => getReservationMib(id) > 0,
38209
38213
  readUsage: async () => {
38210
38214
  const usage = await readEffectiveUsage(null);
38211
38215
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@impz/testing",
3
- "version": "6.9.0",
3
+ "version": "6.9.1",
4
4
  "description": "A real impd on stand-ins, for Bun tests of code that drives impd through @impz/client",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -43,7 +43,7 @@
43
43
  "ts-pattern": "^5.9.2",
44
44
  "xstate": "^5.33.3",
45
45
  "zod": "^4.6.7",
46
- "@impz/client": "6.9.0"
46
+ "@impz/client": "6.9.1"
47
47
  },
48
48
  "engines": {
49
49
  "bun": ">=1.4.3"