@mark1russell7/harness 0.16.21 → 0.16.23

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.
@@ -156,6 +156,11 @@ interface HostLimits {
156
156
  /** This amount is the limit of the memory and the swap together, in bytes. It is equal to `Memory`, thus the container has no swap. */
157
157
  MemorySwap?: number;
158
158
  }
159
+ /**
160
+ * This function gives the numbers of the CPUs of a list, as `cpuset.cpus` takes it: `0`, `2-3` or `0,2`.
161
+ * The numbers are in order, each one time. A text that is not a list gives null.
162
+ */
163
+ declare const cpusOfList: (text: string) => readonly number[] | null;
159
164
  /** This function gives the problems of the limits of a container, each as a sentence. Limits with no problem give an empty list. */
160
165
  declare const limitsProblems: (limits: ContainerLimits) => string[];
161
166
  /**
@@ -1453,6 +1458,44 @@ interface Target {
1453
1458
  */
1454
1459
  readonly limits?: ContainerLimits;
1455
1460
  }
1461
+ /**
1462
+ * The CPU shares of a set of CPUs are the shares of each state of its CPU time between two readings of
1463
+ * `/proc/stat` (`cpuShares`). Each share goes from 0 to 1, and the sum of the eight states is 1.
1464
+ */
1465
+ interface CpuShares {
1466
+ /** This list is the CPUs of the set, as `cpuset.cpus` takes it, for example `0` or `1-3`. */
1467
+ readonly cpus: string;
1468
+ /** This count is the number of CPUs in the set. */
1469
+ readonly count: number;
1470
+ /** This count is the busy cores of the set: the count times the share of the states that are not `idle` or `iowait`. */
1471
+ readonly busy: number;
1472
+ /** This share is the time of processes in user mode, with the time of guests. */
1473
+ readonly user: number;
1474
+ /** This share is the time of processes with a low priority in user mode. */
1475
+ readonly nice: number;
1476
+ /** This share is the time of processes in kernel mode. */
1477
+ readonly system: number;
1478
+ /** This share is the time with no work. */
1479
+ readonly idle: number;
1480
+ /** This share is the time with no work while a read or a write of a disk waited. */
1481
+ readonly iowait: number;
1482
+ /** This share is the time of hardware interrupts. */
1483
+ readonly irq: number;
1484
+ /** This share is the time of software interrupts, for example the packets of the network. */
1485
+ readonly softirq: number;
1486
+ /** This share is the time that the host gave to another guest while this one had work. */
1487
+ readonly steal: number;
1488
+ }
1489
+ /**
1490
+ * The run CPUs are the CPU shares of the CPU set of the target and of the client in one run. The time of
1491
+ * a CPU outside the cgroup of its container is in them too, for example `softirq` and other processes.
1492
+ */
1493
+ interface RunCpus {
1494
+ /** These are the shares of the CPUs of `Target.limits.cpuset`. */
1495
+ readonly target?: CpuShares;
1496
+ /** These are the shares of the CPUs of `Cell.clientLimits.cpuset`. */
1497
+ readonly client?: CpuShares;
1498
+ }
1456
1499
  /**
1457
1500
  * These are the limits of one container of a lab, as Docker writes them into the cgroup of the
1458
1501
  * container. A measurement of the cost of a server gives the server a CPU limit and a memory
@@ -1982,6 +2025,14 @@ interface Run {
1982
2025
  * writes it with its first cell on layer E4.
1983
2026
  */
1984
2027
  readonly steal?: number;
2028
+ /**
2029
+ * These are the CPU shares of the CPUs of the target and of the client in the run, from `/proc/stat`
2030
+ * (`cpuShares`). A run of a plain cell writes the shares of each container with a `cpuset`.
2031
+ *
2032
+ * - The window starts before the client starts, and it ends after the client stops.
2033
+ * - `RunResources.cpus` has the shares in the window of the readings of the resources.
2034
+ */
2035
+ readonly cpus?: RunCpus;
1985
2036
  /** These are the addresses and the namespaces of a topology, which the measurement of a run reads. */
1986
2037
  readonly topology?: RunTopology;
1987
2038
  /** These are the lines of the routers of a topology from the start to the end of the run. */
@@ -2013,6 +2064,11 @@ interface RunResources {
2013
2064
  readonly end: ResourceReading;
2014
2065
  /** These are the readings of the series of the reader, from its start to its stop. A reader with no period has none. */
2015
2066
  readonly series: readonly ResourceReading[];
2067
+ /**
2068
+ * These are the CPU shares of the CPUs of the target and of the client between the readings `start`
2069
+ * and `end`. They come from `/proc/stat` (`runCpusOf`). A cell with a `cpuset` writes them.
2070
+ */
2071
+ readonly cpus?: RunCpus;
2016
2072
  }
2017
2073
  /** A run route is one change of a route at a leaf of a fabric, on the monotonic clock. */
2018
2074
  interface RunRoute {
@@ -2144,4 +2200,4 @@ interface RunTopology {
2144
2200
  };
2145
2201
  }>>;
2146
2202
  }
2147
- export { MemoryThrottlePrediction as $, RESOURCES_EVENT as $t, HopEvent as A, RunFabric as At, KernelRecord as B, Shipped as Bt, Fault as C, resourceReadingOf as Cn, Replies as Ct, GroupPrediction as D, Run as Dt, GroupPlace as E, RttRange as Et, HttpProbe as F, RunRoute as Ft, LoadPlan as G, Target as Gt, LineMatch as H, Stage as Ht, ImageSource as I, RunStream as It, MemoryLimits as J, WsProbe as Jt, LoadPrediction as K, Topology as Kt, Jitter as L, RunTopology as Lt, HopSignal as M, RunPart as Mt, HopWrite as N, RunPause as Nt, GroupRole as O, RunBackup as Ot, HostSysctl as P, RunResources as Pt, MemoryStep as Q, HostLimits as Qt, Kafka as R, SentinelEvent as Rt, FabricManifest as S, resourceReadingIn as Sn, ReplicaSetStage as St, Group as T, RouterHop as Tt, LoadBand as U, StageBand as Ut, LineCount as V, ShippedImage as Vt, LoadConnections as W, Subject as Wt, MemoryOomTask as X, isHopPlace as Xt, MemoryOomPrediction as Y, environmentProblems as Yt, MemoryPrediction as Z, latestEndOf as Zt, DriverStep as _, limitsProblems as _n, QueuePrediction as _t, ClientCapability as a, ResourceMemory as an, Pair as at, EgressPrediction as b, resourceArgs as bn, Reference as bt, ClusterClientAt as c, ResourceReader as cn, PinnedImage as ct, ContainerLimits as d, cgroupKeyed as dn, ProbeEvent as dt, RESOURCES_PROGRAM as en, MiddleboxEvent as et, CountBand as f, cgroupLimit as fn, ProxyHop as ft, DriverBand as g, hostLimitsOf as gn, QueueEnd as gt, DrillRoom as h, cpuStatOf as hn, QueueConnection as ht, Client as i, ResourceLimits as in, Outcomes as it, HopPlace as j, RunGroup as jt, Hop as k, RunDrill as kt, ClusterStage as l, ResourceReading as ln, PortsPrediction as lt, Drill as m, cpuMaxOf as mn, QueueBand as mt, CLIENT_CAPABILITIES as n, ResourceCpu as nn, MiddleboxForm as nt, ClientImage as o, ResourceNetwork as on, PauseBand as ot, DeliveryPrediction as p, cgroupNumber as pn, ProxyTime as pt, LoadStream as q, Toxic as qt, Cell as r, ResourceDevice as rn, Observer as rt, Cluster as s, ResourceOptions as sn, PausePrediction as st, BuildImage as t, ResourceChange as tn, MiddleboxExpectation as tt, ConntrackPrediction as u, ResourceTraffic as un, Prediction as ut, EgressBurst as v, memoryStatOf as vn, Reconnects as vt, FaultPlace as w, RequestPrediction as wt, Fabric as x, resourceChange as xn, ReplicaSet as xt, EgressPacketLaw as y, networkOf as yn, Recovers as yt, KafkaPause as z, SentinelStage as zt };
2203
+ export { MemoryStep as $, latestEndOf as $t, Hop as A, RunCpus as At, KafkaPause as B, SentinelEvent as Bt, FabricManifest as C, resourceArgs as Cn, ReplicaSetStage as Ct, GroupPlace as D, RttRange as Dt, Group as E, resourceReadingOf as En, RouterHop as Et, HostSysctl as F, RunPause as Ft, LoadConnections as G, StageBand as Gt, LineCount as H, Shipped as Ht, HttpProbe as I, RunResources as It, LoadStream as J, Topology as Jt, LoadPlan as K, Subject as Kt, ImageSource as L, RunRoute as Lt, HopPlace as M, RunFabric as Mt, HopSignal as N, RunGroup as Nt, GroupPrediction as O, Run as Ot, HopWrite as P, RunPart as Pt, MemoryPrediction as Q, isHopPlace as Qt, Jitter as R, RunStream as Rt, Fabric as S, networkOf as Sn, ReplicaSet as St, FaultPlace as T, resourceReadingIn as Tn, RequestPrediction as Tt, LineMatch as U, ShippedImage as Ut, KernelRecord as V, SentinelStage as Vt, LoadBand as W, Stage as Wt, MemoryOomPrediction as X, WsProbe as Xt, MemoryLimits as Y, Toxic as Yt, MemoryOomTask as Z, environmentProblems as Zt, DriverBand as _, cpuStatOf as _n, QueueEnd as _t, ClientCapability as a, ResourceDevice as an, Outcomes as at, EgressPacketLaw as b, limitsProblems as bn, Recovers as bt, ClusterClientAt as c, ResourceNetwork as cn, PausePrediction as ct, ContainerLimits as d, ResourceReading as dn, Prediction as dt, HostLimits as en, MemoryThrottlePrediction as et, CountBand as f, ResourceTraffic as fn, ProbeEvent as ft, DrillRoom as g, cpuMaxOf as gn, QueueConnection as gt, Drill as h, cgroupNumber as hn, QueueBand as ht, Client as i, ResourceCpu as in, Observer as it, HopEvent as j, RunDrill as jt, GroupRole as k, RunBackup as kt, ClusterStage as l, ResourceOptions as ln, PinnedImage as lt, DeliveryPrediction as m, cgroupLimit as mn, ProxyTime as mt, CLIENT_CAPABILITIES as n, RESOURCES_PROGRAM as nn, MiddleboxExpectation as nt, ClientImage as o, ResourceLimits as on, Pair as ot, CpuShares as p, cgroupKeyed as pn, ProxyHop as pt, LoadPrediction as q, Target as qt, Cell as r, ResourceChange as rn, MiddleboxForm as rt, Cluster as s, ResourceMemory as sn, PauseBand as st, BuildImage as t, RESOURCES_EVENT as tn, MiddleboxEvent as tt, ConntrackPrediction as u, ResourceReader as un, PortsPrediction as ut, DriverStep as v, cpusOfList as vn, QueuePrediction as vt, Fault as w, resourceChange as wn, Replies as wt, EgressPrediction as x, memoryStatOf as xn, Reference as xt, EgressBurst as y, hostLimitsOf as yn, Reconnects as yt, Kafka as z, RunTopology as zt };
@@ -388,11 +388,22 @@ const bytesOf = (memory) => {
388
388
  return null;
389
389
  }
390
390
  };
391
+ /**
392
+ * This function gives the numbers of the CPUs of a list, as `cpuset.cpus` takes it: `0`, `2-3` or `0,2`.
393
+ * The numbers are in order, each one time. A text that is not a list gives null.
394
+ */
395
+ const cpusOfList = (text) => {
396
+ if (!/^\d+(-\d+)?(,\d+(-\d+)?)*$/.test(text)) return null;
397
+ const cpus = /* @__PURE__ */ new Set();
398
+ for (const range of text.split(",")) {
399
+ const [first, last = first] = range.split("-").map(Number);
400
+ if (first > last) return null;
401
+ for (let cpu = first; cpu <= last; cpu += 1) cpus.add(cpu);
402
+ }
403
+ return [...cpus].sort((a, b) => a - b);
404
+ };
391
405
  /** This function tells that a text is a list of CPUs, as `cpuset.cpus` takes it: `0`, `2-3` or `0,2`. */
392
- const isCpuList = (text) => /^\d+(-\d+)?(,\d+(-\d+)?)*$/.test(text) && text.split(",").every((range) => {
393
- const [first, last] = range.split("-").map(Number);
394
- return last === void 0 || first <= last;
395
- });
406
+ const isCpuList = (text) => cpusOfList(text) !== null;
396
407
  /** This function gives the problems of the limits of a container, each as a sentence. Limits with no problem give an empty list. */
397
408
  const limitsProblems = (limits) => {
398
409
  const problems = [];
@@ -1451,6 +1462,6 @@ const grpcClientImage = () => imageOf(shipped("grpc"));
1451
1462
  const targetSourceOf = (target) => target.subject ?? target.image;
1452
1463
  /** This function gives the image that a target operates: the image of its subject, or its stock image. */
1453
1464
  const targetImageOf = (target) => imageOf(targetSourceOf(target));
1454
- export { hostLimitsOf as $, targetSourceOf as A, versionsOf as B, programOf as C, subjectClient as D, sources as E, goVersions as F, requestFirst as G, environmentProblems as H, jarVersions as I, cgroupKeyed as J, RESOURCES_EVENT as K, locksOf as L, unpinnedBases as M, LOCK_NAMES as N, subjectProblems as O, cargoVersions as P, cpuStatOf as Q, npmDrift as R, planOf as S, shippedSource as T, isHopPlace as U, CLIENT_CAPABILITIES as V, latestEndOf as W, cgroupNumber as X, cgroupLimit as Y, cpuMaxOf as Z, kafkaClientImage as _, loadPlanOf as _t, SHIPPED_NAMES as a, resourceReadingIn as at, nodeHttpImage as b, streamsLoadOf as bt, buildRecordOf as c, LOAD_FORMAT as ct, harnessImage as d, SCHEDULE_PATH as dt, limitsProblems as et, harnessVersion as f, connectionsProblems as ft, inContext as g, loadOf as gt, imageProblems as h, loadEnds as ht, SHIPPED_CLIENTS as i, resourceChange as it, unlockedManifests as j, targetImageOf as k, goHttpImage as l, LOAD_PATH as lt, imageOf as m, estimateVerdict as mt, PINNED as n, networkOf as nt, amqpClientImage as o, resourceReadingOf as ot, hikariClientImage as p, estimateOf as pt, RESOURCES_PROGRAM as q, REPOSITORY as r, resourceArgs as rt, basesOf as s, CLOSED_TOLERANCE as st, CLIENT_NAMES as t, memoryStatOf as tt, grpcClientImage as u, LOAD_POOL_LIMIT as ut, mongoClientImage as v, loadVerdict as vt, routerImage as w, pgClientImage as x, nodeClientImage as y, poolOf as yt, npmVersions as z };
1465
+ export { cpusOfList as $, targetSourceOf as A, versionsOf as B, programOf as C, subjectClient as D, sources as E, goVersions as F, requestFirst as G, environmentProblems as H, jarVersions as I, cgroupKeyed as J, RESOURCES_EVENT as K, locksOf as L, unpinnedBases as M, LOCK_NAMES as N, subjectProblems as O, cargoVersions as P, cpuStatOf as Q, npmDrift as R, planOf as S, shippedSource as T, isHopPlace as U, CLIENT_CAPABILITIES as V, latestEndOf as W, cgroupNumber as X, cgroupLimit as Y, cpuMaxOf as Z, kafkaClientImage as _, loadOf as _t, SHIPPED_NAMES as a, resourceChange as at, nodeHttpImage as b, poolOf as bt, buildRecordOf as c, CLOSED_TOLERANCE as ct, harnessImage as d, LOAD_POOL_LIMIT as dt, hostLimitsOf as et, harnessVersion as f, SCHEDULE_PATH as ft, inContext as g, loadEnds as gt, imageProblems as h, estimateVerdict as ht, SHIPPED_CLIENTS as i, resourceArgs as it, unlockedManifests as j, targetImageOf as k, goHttpImage as l, LOAD_FORMAT as lt, imageOf as m, estimateOf as mt, PINNED as n, memoryStatOf as nt, amqpClientImage as o, resourceReadingIn as ot, hikariClientImage as p, connectionsProblems as pt, RESOURCES_PROGRAM as q, REPOSITORY as r, networkOf as rt, basesOf as s, resourceReadingOf as st, CLIENT_NAMES as t, limitsProblems as tt, grpcClientImage as u, LOAD_PATH as ut, mongoClientImage as v, loadPlanOf as vt, routerImage as w, pgClientImage as x, streamsLoadOf as xt, nodeClientImage as y, loadVerdict as yt, npmVersions as z };
1455
1466
 
1456
- //# sourceMappingURL=image-Dzofp1ab.js.map
1467
+ //# sourceMappingURL=image-B1jai9Lq.js.map