@mark1russell7/capacity 0.1.0 → 0.1.2
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/README.md +10 -0
- package/build/index.d.ts +14 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +28 -2
- package/build/index.js.map +1 -1
- package/build/{instance-check-CAuD9L4Z.js → instance-check-Bt-SI8va.js} +22 -1
- package/build/instance-check-Bt-SI8va.js.map +1 -0
- package/build/{instance-0n6WhJzF.d.ts → instance-sZmVOOvz.d.ts} +22 -3
- package/build/instance-sZmVOOvz.d.ts.map +1 -0
- package/build/schema.d.ts +1 -1
- package/build/schema.d.ts.map +1 -1
- package/build/schema.js +12 -2
- package/build/schema.js.map +1 -1
- package/package.json +1 -1
- package/src/check.ts +25 -0
- package/src/gate.ts +31 -0
- package/src/index.ts +2 -1
- package/src/law.ts +21 -0
- package/src/schema.ts +3 -0
- package/build/instance-0n6WhJzF.d.ts.map +0 -1
- package/build/instance-check-CAuD9L4Z.js.map +0 -1
package/README.md
CHANGED
|
@@ -33,6 +33,7 @@ A law is plain data, thus a law file is JSON. Its format is `capacity-law/1`.
|
|
|
33
33
|
| `points` | Optional. Each point that the fit used, in the order of the residuals: its load, its value, the index of its run in `evidence.runs` and the start time of its job. |
|
|
34
34
|
| `evidence` | The CI runs that measured the points: an address, a commit and a time for each. |
|
|
35
35
|
| `noise` | The noise floor of the measure on one CPU model, the CPU model, and the CI runs that measured the floor. |
|
|
36
|
+
| `idle` | Optional. The idle base of a law with the condition `idle` "net": its load, its CPU model, the counts `bases` and `runs`, and the median of each idle measure. |
|
|
36
37
|
|
|
37
38
|
A law holds for the ranges of its variables and for its conditions. A value outside a range is an extrapolation, and the answer says so.
|
|
38
39
|
|
|
@@ -197,6 +198,7 @@ The options, the search and the fields `edge`, `search` and `outside` are as in
|
|
|
197
198
|
- The evidence names one run or more, each with an `https` address, a full commit and a UTC time.
|
|
198
199
|
- A law with points has one point for each residual. Each point gives a finite value of each variable in its range, a finite value and the index of a run of the evidence.
|
|
199
200
|
- The noise has a floor of 0 or more and a CPU model. It names its runs as the evidence does.
|
|
201
|
+
- A law with the condition `idle` "net" has an idle base, and a law with an idle base has the condition. The base has a load and a CPU model. It has 1 base or more, at least 1 run for each base and a finite amount of each measure.
|
|
200
202
|
|
|
201
203
|
The noise floor is two standard deviations of the differences of A/A pairs: two equal cases, each in its own container. A difference of two measurements below the floor is not a result. The plan `floor` of the lab measures it each night, on the CPU model of the runner.
|
|
202
204
|
|
|
@@ -439,6 +441,14 @@ if (gate.outcome === "block") console.log(gate.reason);
|
|
|
439
441
|
- **A low side is a block too.** The subject is faster or smaller than its law, thus the law is out of date. A new fit must replace it.
|
|
440
442
|
- **No read.** The function `gateOf` of `@mark1russell7/rigor-bench` joins the laws. A law with fewer than two jobs gives no read. So does a law with too few reads to reject a side. A gate with no law gives no read. It does not pass.
|
|
441
443
|
|
|
444
|
+
### The reads that a job needs
|
|
445
|
+
|
|
446
|
+
A job with few reads cannot reject a side, also when each of its reads is on that side. More jobs do not correct this. `gateReadsFor(jobs, laws)` gives the least count of reads in each job with which the gate can decide a law.
|
|
447
|
+
|
|
448
|
+
- **The rule.** It is the least count r for which `jobs` jobs, each with r reads on one side, give a p of `alpha / (2 × laws)` or less.
|
|
449
|
+
- **An example.** At 13 jobs and 9 laws, a job needs 3 reads. With 2 reads, the best p is 12 × 0.025² = 0.0075. That is above 0.01 / 18.
|
|
450
|
+
- **The use.** A plan of a gate gives each job at least this count of points in the range of each law. The lab examines each gate plan against its law files with this rule.
|
|
451
|
+
|
|
442
452
|
The caller gives the jobs of each law. Each job measured the subject in the conditions of the law. A job with `noRead` gives no read, for example a job with a noise floor over its limit. The lab gives the jobs, the noise rule and the workflow (CAP-26).
|
|
443
453
|
|
|
444
454
|
A study used the 8 jobs of the laws of the request rate on the Intel Xeon 6975P-C, at eight rates from 1000 to 30000:
|
package/build/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*
|
|
16
16
|
* @packageDocumentation
|
|
17
17
|
*/
|
|
18
|
-
import { $ as AppProcess, $t as
|
|
18
|
+
import { $ as AppProcess, $t as bootstrapDraws, A as compositionValue, At as lawValue, B as shareOf, Bt as LawIdle, C as LawPart, Ct as WorkloadSource, D as Over, Dt as LoadPoint, E as NestedTerm, Et as LevelOptions, F as ShareOptions, Ft as Fit, G as AppClass, Gt as Noise, H as APP_FILE, Ht as Loser, I as instancePointOf, It as FitError, J as AppEntry, Jt as ResidualKind, K as AppCommand, Kt as Problem, L as loadPointOf, Lt as Form, M as Load, Mt as Constant, N as PointLaw, Nt as DEFAULT_LEVEL, O as PartValue, Ot as Range, P as PointOptions, Pt as Evidence, Q as AppProblemCode, Qt as Variable, R as mergeDemands, Rt as LAW_FORMAT, S as CompositionValue, St as WorkloadProblemCode, T as NestedPart, Tt as LawValue, U as APP_FORMAT, Ut as MAX_VARIABLES, V as totalRate, Vt as LawProblem, W as APP_LINE_KINDS, Wt as Measure, X as AppLineKind, Xt as RunPoint, Y as AppLine, Yt as Run, Z as AppProblem, Zt as Scale, _ as Composition, _t as RATE, a as InstanceProblem, at as AppStart, b as CompositionProblemCode, bt as WorkloadClass, c as LIMITS_FORMAT, ct as MetricsGap, d as LimitProblemCode, dt as VariableKind, en as leastCount, et as AppRange, f as LimitSet, ft as Amounts, g as Catalog, gt as PlanSource, h as COMPOSITION_FORMAT, ht as NO_DEMAND, i as Instance, it as AppService, j as isLawTerm, jt as ConditionValue, k as checkComposition, kt as constantIntervals, l as Limit, lt as SeriesTarget, m as ResourceCeiling, mt as MetricsSource, n as Ceiling, nt as AppRun, o as InstanceProblemCode, ot as AppVariable, p as RESOURCE_UNITS, pt as Demand, q as AppContract, qt as ProblemCode, r as INSTANCE_FORMAT, rt as AppSeries, s as InstanceType, st as HttpEntry, t as AmountCeiling, tn as leastGroups, tt as AppReady, u as LimitProblem, ut as ServiceEntry, v as CompositionOptions, vt as WORKLOAD_FORMAT, w as LawTerm, wt as ConstantInterval, x as CompositionTerm, xt as WorkloadProblem, y as CompositionProblem, yt as Workload, z as scaleDemand, zt as Law } from "./instance-sZmVOOvz.js";
|
|
19
19
|
import { Quantity } from "@mark1russell7/quantity";
|
|
20
20
|
import { Expr } from "@mark1russell7/vex";
|
|
21
21
|
import { Result } from "@mark1russell7/optional";
|
|
@@ -487,6 +487,18 @@ interface LawGate extends Gate {
|
|
|
487
487
|
* The function throws a `RangeError` for a level, an alpha or a count of jobs that is not valid.
|
|
488
488
|
*/
|
|
489
489
|
export declare const lawGate: (cases: readonly GateCase[], options?: LawGateOptions) => LawGate;
|
|
490
|
+
/**
|
|
491
|
+
* This function gives the least count of reads in each job with which `lawGate` can decide a case. Let each job have r
|
|
492
|
+
* reads, each on one side. The count is the least r for which `jobs` jobs give a p of `alpha / (2 × laws)` or less. This
|
|
493
|
+
* bound is the first step of Holm when each of `laws` laws is a case of the gate.
|
|
494
|
+
*
|
|
495
|
+
* A job with fewer reads cannot reject a side, also when each of its reads is on that side. Thus a plan of a gate must
|
|
496
|
+
* give each job this count of points that each law reads. More jobs do not correct too few reads in each job.
|
|
497
|
+
*
|
|
498
|
+
* The function throws a `RangeError` in three cases. The first is `jobs` or `laws` that is not a whole number above 0.
|
|
499
|
+
* The second is `jobs` below the count of jobs of a side. The third is no count up to 64 reads that can decide.
|
|
500
|
+
*/
|
|
501
|
+
export declare const gateReadsFor: (jobs: number, laws: number, options?: LawGateOptions) => number;
|
|
490
502
|
/**
|
|
491
503
|
* This function examines a demand and gives each problem that it finds. A demand with no problem
|
|
492
504
|
* gives an empty list.
|
|
@@ -854,5 +866,5 @@ interface ScaleLadder {
|
|
|
854
866
|
* go from a number above 0 to a larger finite number.
|
|
855
867
|
*/
|
|
856
868
|
export declare const scaleLadder: (model: ScaleModel, demand: Demand, range: Range, options?: ScaleOptions) => Result<ScaleLadder, ScaleProblem>;
|
|
857
|
-
export { APP_FILE, APP_FORMAT, APP_LINE_KINDS, type AmountCeiling, type Amounts, type AppClass, type AppCommand, type AppContract, type AppEntry, type AppLine, type AppLineKind, type AppProblem, type AppProblemCode, type AppProcess, type AppRange, type AppReady, type AppRun, type AppSeries, type AppService, type AppStart, type AppVariable, type Binding, type Bounds, COMPOSITION_FORMAT, type Catalog, type CatalogForm, type Ceiling, type Composition, type CompositionOptions, type CompositionProblem, type CompositionProblemCode, type CompositionTerm, type CompositionValue, type ConditionValue, type Constant, type ConstantInterval, type CountReach, type Crossing, DEFAULT_LEVEL, type Demand, type Evidence, type Fit, type FitError, type Floor, type Form, type FormRank, type GateCase, type GateJob, type GateRead, type Grid, type HttpEntry, INSTANCE_FORMAT, type Instance, type InstanceProblem, type InstanceProblemCode, type InstanceType, type JobCount, type Knee, type KneeOptions, type KneeRule, LAW_FORMAT, LIMITS_FORMAT, type Law, type LawFit, type LawFitOptions, type LawGate, type LawGateCase, type LawGateOptions, type LawPart, type LawProblem, type LawRead, type LawTerm, type LawValue, type LevelOptions, type Limit, type LimitCount, type LimitLadder, type LimitProblem, type LimitProblemCode, type LimitReach, type LimitSet, type LimitUse, type Load, type LoadPoint, type Loser, MAX_VARIABLES, type Measure, type MetricsGap, type MetricsSource, type MetricsWindow, NO_DEMAND, type NestedPart, type NestedTerm, type NoReadJob, type Noise, type Observation, type ObservedClass, type OpenRange, type OpenValue, type Over, type PartValue, type PlanSource, type PointLaw, type PointOptions, type Points, type Problem, type ProblemCode, RATE, RESOURCE_UNITS, type Range, type Reach, type ReadSide, type ResidualKind, type ResourceCeiling, type Run, type RunPoint, type Scale, type ScaleLadder, type ScaleModel, type ScaleOptions, type ScaleProblem, type ScaleProblemCode, type ScaleRule, type SeriesReading, type SeriesTarget, type ServiceEntry, type Shape, type ShareOptions, type SideTest, type Start, type Term, type Variable, type VariableKind, WORKLOAD_FORMAT, type Workload, type WorkloadClass, type WorkloadName, type WorkloadProblem, type WorkloadProblemCode, type WorkloadSource, bootstrapDraws, checkComposition, compositionValue, constantIntervals, instancePointOf, isLawTerm, lawValue, leastCount, leastGroups, loadPointOf, mergeDemands, scaleDemand, shareOf, totalRate };
|
|
869
|
+
export { APP_FILE, APP_FORMAT, APP_LINE_KINDS, type AmountCeiling, type Amounts, type AppClass, type AppCommand, type AppContract, type AppEntry, type AppLine, type AppLineKind, type AppProblem, type AppProblemCode, type AppProcess, type AppRange, type AppReady, type AppRun, type AppSeries, type AppService, type AppStart, type AppVariable, type Binding, type Bounds, COMPOSITION_FORMAT, type Catalog, type CatalogForm, type Ceiling, type Composition, type CompositionOptions, type CompositionProblem, type CompositionProblemCode, type CompositionTerm, type CompositionValue, type ConditionValue, type Constant, type ConstantInterval, type CountReach, type Crossing, DEFAULT_LEVEL, type Demand, type Evidence, type Fit, type FitError, type Floor, type Form, type FormRank, type GateCase, type GateJob, type GateRead, type Grid, type HttpEntry, INSTANCE_FORMAT, type Instance, type InstanceProblem, type InstanceProblemCode, type InstanceType, type JobCount, type Knee, type KneeOptions, type KneeRule, LAW_FORMAT, LIMITS_FORMAT, type Law, type LawFit, type LawFitOptions, type LawGate, type LawGateCase, type LawGateOptions, type LawIdle, type LawPart, type LawProblem, type LawRead, type LawTerm, type LawValue, type LevelOptions, type Limit, type LimitCount, type LimitLadder, type LimitProblem, type LimitProblemCode, type LimitReach, type LimitSet, type LimitUse, type Load, type LoadPoint, type Loser, MAX_VARIABLES, type Measure, type MetricsGap, type MetricsSource, type MetricsWindow, NO_DEMAND, type NestedPart, type NestedTerm, type NoReadJob, type Noise, type Observation, type ObservedClass, type OpenRange, type OpenValue, type Over, type PartValue, type PlanSource, type PointLaw, type PointOptions, type Points, type Problem, type ProblemCode, RATE, RESOURCE_UNITS, type Range, type Reach, type ReadSide, type ResidualKind, type ResourceCeiling, type Run, type RunPoint, type Scale, type ScaleLadder, type ScaleModel, type ScaleOptions, type ScaleProblem, type ScaleProblemCode, type ScaleRule, type SeriesReading, type SeriesTarget, type ServiceEntry, type Shape, type ShareOptions, type SideTest, type Start, type Term, type Variable, type VariableKind, WORKLOAD_FORMAT, type Workload, type WorkloadClass, type WorkloadName, type WorkloadProblem, type WorkloadProblemCode, type WorkloadSource, bootstrapDraws, checkComposition, compositionValue, constantIntervals, instancePointOf, isLawTerm, lawValue, leastCount, leastGroups, loadPointOf, mergeDemands, scaleDemand, shareOf, totalRate };
|
|
858
870
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/names.ts","../src/check.ts","../src/forms.ts","../src/fit.ts","../src/knee.ts","../src/gate.ts","../src/workload-check.ts","../src/app-check.ts","../src/observe.ts","../src/app-metrics.ts","../src/instance-check.ts","../src/limit.ts","../src/scale.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;qBAGa,MAAM;;qBAGN,MAAM;;;;;;;;;;;;;;;;;;qBCuCN,WAAY,KAAK,iBAAe;;qBCtChC;;;;;;UAOI;WACN;WACA,OAAO;WACP,OAAO;;;;;;;;;;KAWN;WACG;;WACA;WAAyB;WAAqC;;;;;;;;;KASjE;WAAoB;;WAA6B;;WAA4B;WAAwB;;;;;;UAMhG;WACN;WACA,MAAM;WACN,SAAS;;;;;;UAOH;WACN;WACA;WACA,gBAAgB;WAChB,iBAAiB;;;;;;UAOX;WACN;WACA,YAAY,SAAS;;;UAIf;WACN;WACA;;;UAIM;WACN,oBAAoB;WACpB;;;;;;;;;;;;;;;;;;qBAoCE,gBAAgB;;qBAgGhB,cAAe,eAAa;;qBAG5B,gBAAiB,MAAM;;qBAsBvB,YAAa,MAAM,aAAa,SAAS,YAAU;;qBAGnD,UAAW,MAAM,aAAa,SAAS,YAAU;;qBAGjD,SAAU,MAAM,aAAa,SAAS,YAAU;;qBAMhD,aACX,MAAM,aACN,uBACA,WAAW,SAAS,4BACnB;;qBAGU,aACX,MAAM,aACN,uBACA,WAAW,SAAS,4BACnB;;qBAMU,SAAU,MAAM,MAAM;;;;;;qBA4BtB,cAAe,MAAM,aAAa,0BAAwB;;;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ACA;WACA;;WAEA;WACA;;WAEA;;;UAIM;WACN;;WAEA;;WAEA;WACA;;;UAIM;WACN;WACA;;;UAIM,oBAAoB;;WAE1B;WACA,SAAS;;WAET;WACA,eAAe;WACf,iBAAiB;;WAEjB,gBAAgB;;;UAIV,gBAAgB;WACtB;WACA;;WAEA;;WAEA;WACA,gBAAgB;;;;;;;;;;;;;;;;;;;;qBAoDd,UAAW,gBAAgB,YAAY,UAAS,mBAAsB;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/names.ts","../src/check.ts","../src/forms.ts","../src/fit.ts","../src/knee.ts","../src/gate.ts","../src/workload-check.ts","../src/app-check.ts","../src/observe.ts","../src/app-metrics.ts","../src/instance-check.ts","../src/limit.ts","../src/scale.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;qBAGa,MAAM;;qBAGN,MAAM;;;;;;;;;;;;;;;;;;qBCuCN,WAAY,KAAK,iBAAe;;qBCtChC;;;;;;UAOI;WACN;WACA,OAAO;WACP,OAAO;;;;;;;;;;KAWN;WACG;;WACA;WAAyB;WAAqC;;;;;;;;;KASjE;WAAoB;;WAA6B;;WAA4B;WAAwB;;;;;;UAMhG;WACN;WACA,MAAM;WACN,SAAS;;;;;;UAOH;WACN;WACA;WACA,gBAAgB;WAChB,iBAAiB;;;;;;UAOX;WACN;WACA,YAAY,SAAS;;;UAIf;WACN;WACA;;;UAIM;WACN,oBAAoB;WACpB;;;;;;;;;;;;;;;;;;qBAoCE,gBAAgB;;qBAgGhB,cAAe,eAAa;;qBAG5B,gBAAiB,MAAM;;qBAsBvB,YAAa,MAAM,aAAa,SAAS,YAAU;;qBAGnD,UAAW,MAAM,aAAa,SAAS,YAAU;;qBAGjD,SAAU,MAAM,aAAa,SAAS,YAAU;;qBAMhD,aACX,MAAM,aACN,uBACA,WAAW,SAAS,4BACnB;;qBAGU,aACX,MAAM,aACN,uBACA,WAAW,SAAS,4BACnB;;qBAMU,SAAU,MAAM,MAAM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AT, C as shareOf, D as fillPlaceholders, E as checkApp, F as checkWorkload, G as checkLaw, H as intervalOf, I as demandProblems, J as valuesAt, L as workloadProblem, M as APP_FILE, N as APP_FORMAT, O as isHttps, P as APP_LINE_KINDS, Q as finite, R as NO_DEMAND, S as scaleDemand, T as appWorkloadProblems, U as lawValue, V as constantIntervals, W as levelProblem, X as NAME, Y as valuesOf, Z as SLUG, _ as rowValuesOf, a as limitProblems, at as leastCount, b as mergeDemands, c as RESOURCE_UNITS, d as compositionValue, et as repeated, f as flatPartsOf, g as rowValueOf, h as preparedOf, i as limitProblem, it as bootstrapDraws, j as requestPath, k as metricsGaps, l as COMPOSITION_FORMAT, m as partsOutside, n as checkLimits, nt as LAW_FORMAT, o as INSTANCE_FORMAT, ot as leastGroups, p as isLawTerm, q as recordOf, r as instanceProblems, rt as MAX_VARIABLES, s as LIMITS_FORMAT, t as checkInstance, tt as DEFAULT_LEVEL, u as checkComposition, v as instancePointOf, w as totalRate, x as portionOf, y as loadPointOf, z as RATE } from "./instance-check-
|
|
1
|
+
import { $ as isUtc, A as placeholdersOf, B as WORKLOAD_FORMAT, C as shareOf, D as fillPlaceholders, E as checkApp, F as checkWorkload, G as checkLaw, H as intervalOf, I as demandProblems, J as valuesAt, L as workloadProblem, M as APP_FILE, N as APP_FORMAT, O as isHttps, P as APP_LINE_KINDS, Q as finite, R as NO_DEMAND, S as scaleDemand, T as appWorkloadProblems, U as lawValue, V as constantIntervals, W as levelProblem, X as NAME, Y as valuesOf, Z as SLUG, _ as rowValuesOf, a as limitProblems, at as leastCount, b as mergeDemands, c as RESOURCE_UNITS, d as compositionValue, et as repeated, f as flatPartsOf, g as rowValueOf, h as preparedOf, i as limitProblem, it as bootstrapDraws, j as requestPath, k as metricsGaps, l as COMPOSITION_FORMAT, m as partsOutside, n as checkLimits, nt as LAW_FORMAT, o as INSTANCE_FORMAT, ot as leastGroups, p as isLawTerm, q as recordOf, r as instanceProblems, rt as MAX_VARIABLES, s as LIMITS_FORMAT, t as checkInstance, tt as DEFAULT_LEVEL, u as checkComposition, v as instancePointOf, w as totalRate, x as portionOf, y as loadPointOf, z as RATE } from "./instance-check-Bt-SI8va.js";
|
|
2
2
|
import { convertible, factorOf, isCanonicalUnit, isQuantity, kindOf, quantity, scale, valueIn, whyNotConvertible } from "@mark1russell7/quantity";
|
|
3
3
|
import { app, let_, lit, ref, v } from "@mark1russell7/vex";
|
|
4
4
|
import { err, ok } from "@mark1russell7/optional";
|
|
@@ -1103,6 +1103,32 @@ const lawGate = (cases, options = {}) => {
|
|
|
1103
1103
|
cases: outcomes
|
|
1104
1104
|
};
|
|
1105
1105
|
};
|
|
1106
|
+
/** This count is the most reads in one job that `gateReadsFor` examines. */
|
|
1107
|
+
const MAX_GATE_READS = 64;
|
|
1108
|
+
/**
|
|
1109
|
+
* This function gives the least count of reads in each job with which `lawGate` can decide a case. Let each job have r
|
|
1110
|
+
* reads, each on one side. The count is the least r for which `jobs` jobs give a p of `alpha / (2 × laws)` or less. This
|
|
1111
|
+
* bound is the first step of Holm when each of `laws` laws is a case of the gate.
|
|
1112
|
+
*
|
|
1113
|
+
* A job with fewer reads cannot reject a side, also when each of its reads is on that side. Thus a plan of a gate must
|
|
1114
|
+
* give each job this count of points that each law reads. More jobs do not correct too few reads in each job.
|
|
1115
|
+
*
|
|
1116
|
+
* The function throws a `RangeError` in three cases. The first is `jobs` or `laws` that is not a whole number above 0.
|
|
1117
|
+
* The second is `jobs` below the count of jobs of a side. The third is no count up to 64 reads that can decide.
|
|
1118
|
+
*/
|
|
1119
|
+
const gateReadsFor = (jobs, laws, options = {}) => {
|
|
1120
|
+
const level = options.level ?? .95;
|
|
1121
|
+
const alpha = options.alpha ?? .01;
|
|
1122
|
+
const need = options.jobs ?? 2;
|
|
1123
|
+
if (!(level > 0 && level < 1)) throw new RangeError(`The level ${level} is not between 0 and 1.`);
|
|
1124
|
+
if (!(alpha > 0 && alpha < 1)) throw new RangeError(`The alpha ${alpha} is not between 0 and 1.`);
|
|
1125
|
+
if (!Number.isInteger(need) || need < 1) throw new RangeError(`The count of jobs ${need} is not a whole number above 0.`);
|
|
1126
|
+
if (!Number.isInteger(laws) || laws < 1) throw new RangeError(`The count of laws ${laws} is not a whole number above 0.`);
|
|
1127
|
+
if (!Number.isInteger(jobs) || jobs < need) throw new RangeError(`The count of jobs ${jobs} is not a whole number of ${need} or more.`);
|
|
1128
|
+
const share = (1 - level) / 2;
|
|
1129
|
+
for (let reads = 1; reads <= MAX_GATE_READS; reads += 1) if (partialConjunction(Array.from({ length: jobs }, () => binomialTest(reads, reads, share, "greater")), need) <= alpha / (2 * laws)) return reads;
|
|
1130
|
+
throw new RangeError(`At ${jobs} jobs and ${laws} laws, ${MAX_GATE_READS} reads in each job cannot decide a case.`);
|
|
1131
|
+
};
|
|
1106
1132
|
// src/app-metrics.ts
|
|
1107
1133
|
/**
|
|
1108
1134
|
* This function gives the increase of a counter from its values in the order of their times. A value below
|
|
@@ -1708,6 +1734,6 @@ const scaleLadder = (model, demand, range, options = {}) => {
|
|
|
1708
1734
|
reachAt
|
|
1709
1735
|
});
|
|
1710
1736
|
};
|
|
1711
|
-
export { APP_FILE, APP_FORMAT, APP_LINE_KINDS, COMPOSITION_FORMAT, DEFAULT_LEVEL, FORMS, FORM_VARIABLE, GATE_ALPHA, GATE_JOBS, INSTANCE_FORMAT, KNEE_STEPS, LAW_FORMAT, LIMITS_FORMAT, MAX_VARIABLES, NAME, NO_DEMAND, RATE, RESOURCE_UNITS, SCALE_MOST, SCALE_STEPS, SLUG, WORKLOAD_FORMAT, appWorkloadProblems, bootstrapDraws, catalogForm, checkApp, checkComposition, checkInstance, checkLaw, checkLimits, checkWorkload, compositionValue, constantIdsOf, constantIntervals, countReach, counterIncrease, demandProblems, fillPlaceholders, fitLaw, formOf, formSlopes, formValues, gridOf, instancePointOf, instanceProblems, isHttps, isLawTerm, kneeRuleProblem, lawGate, lawKnee, lawReach, lawRead, lawValue, leastCount, leastGroups, limitAmount, limitProblems, limitUse, limitUses, loadPointOf, mergeDemands, metricsGaps, observationOf, observedWorkload, placeholdersOf, programOf, requestPath, scaleDemand, scaleLadder, scaleRule, separableOf, shareOf, slopeOf, startOf, totalRate };
|
|
1737
|
+
export { APP_FILE, APP_FORMAT, APP_LINE_KINDS, COMPOSITION_FORMAT, DEFAULT_LEVEL, FORMS, FORM_VARIABLE, GATE_ALPHA, GATE_JOBS, INSTANCE_FORMAT, KNEE_STEPS, LAW_FORMAT, LIMITS_FORMAT, MAX_VARIABLES, NAME, NO_DEMAND, RATE, RESOURCE_UNITS, SCALE_MOST, SCALE_STEPS, SLUG, WORKLOAD_FORMAT, appWorkloadProblems, bootstrapDraws, catalogForm, checkApp, checkComposition, checkInstance, checkLaw, checkLimits, checkWorkload, compositionValue, constantIdsOf, constantIntervals, countReach, counterIncrease, demandProblems, fillPlaceholders, fitLaw, formOf, formSlopes, formValues, gateReadsFor, gridOf, instancePointOf, instanceProblems, isHttps, isLawTerm, kneeRuleProblem, lawGate, lawKnee, lawReach, lawRead, lawValue, leastCount, leastGroups, limitAmount, limitProblems, limitUse, limitUses, loadPointOf, mergeDemands, metricsGaps, observationOf, observedWorkload, placeholdersOf, programOf, requestPath, scaleDemand, scaleLadder, scaleRule, separableOf, shareOf, slopeOf, startOf, totalRate };
|
|
1712
1738
|
|
|
1713
1739
|
//# sourceMappingURL=index.js.map
|