Skip to content
Astera Technology

Check burst limits beside monthly operation quotas

Test both a short burst and total-period demand against supplied limits.

Download complete case notes and answer keys ↓

Set the decision and its input

The fictional offer allows five operations per second and one thousand per month. Demand is twenty in one second and one hundred in the month. Monthly demand fits, but the burst does not. Overall fit requires both under this supplied buying rule.

Filled local test worksheet
CaseInput JSON
Base test{"perSecond":5,"perMonth":1000,"oneSecondDemand":20,"monthDemand":100}
Download editable CSV ↓

Run the supplied comparison

This is a limit comparison, not an invented retry or queue feature. Whether operations may wait is a separate supplied business condition; no automatic delay is assumed to rescue an immediate task.

Faulty and required outputs
PathOutput JSON
Faulty path{"monthFits":true,"burstFits":false,"overallFits":true}
Required path{"monthFits":true,"burstFits":false,"overallFits":false}
Download editable CSV ↓
Complete local Node24.14.1 programme
import assert from 'node:assert/strict';
const smallWhole=(x,max)=>Number.isSafeInteger(x)&&x>=0&&x<=max;

const run=function run(i,corrected=true){
    if(![i.perSecond,i.perMonth,i.oneSecondDemand,i.monthDemand].every(x=>smallWhole(x,1000000)))return {held:true};
    const monthFits=i.monthDemand<=i.perMonth,burstFits=i.oneSecondDemand<=i.perSecond;
    return {monthFits,burstFits,overallFits:corrected?monthFits&&burstFits:monthFits};
  };
const cases=[{"input":{"perSecond":5,"perMonth":1000,"oneSecondDemand":20,"monthDemand":100},"corrected":false,"expected":{"monthFits":true,"burstFits":false,"overallFits":true}},{"input":{"perSecond":5,"perMonth":1000,"oneSecondDemand":20,"monthDemand":100},"corrected":true,"expected":{"monthFits":true,"burstFits":false,"overallFits":false}},{"input":{"perSecond":5,"perMonth":1000,"oneSecondDemand":5,"monthDemand":1000},"corrected":true,"expected":{"monthFits":true,"burstFits":true,"overallFits":true}},{"input":{"perSecond":null,"perMonth":1000,"oneSecondDemand":20,"monthDemand":100},"corrected":true,"expected":{"held":true}}];
for(const test of cases){const actual=await run(test.input,test.corrected);assert.deepEqual(actual,test.expected);console.log(actual);}
Download runnable example ↓

Choose from the boundary evidence

Exactly five per second and one thousand per month fit the inclusive limits. An unknown burst allowance prevents the combined decision.

  1. Read both time scales
  2. Compare each demand separately
  3. Require both for immediate fit

An unstated burst limit remains unknown.

Editable boundary inputs and outputs
ConditionInput JSONExpected output JSON
both exact limits{"perSecond":5,"perMonth":1000,"oneSecondDemand":5,"monthDemand":1000}{"monthFits":true,"burstFits":true,"overallFits":true}
unknown burst allowance{"perSecond":null,"perMonth":1000,"oneSecondDemand":20,"monthDemand":100}{"held":true}
Download editable CSV ↓

Can the base offer be marked suitable from the monthly count alone?

Show the worked answer

No. One hundred fits one thousand, but twenty exceeds five in the required second. Record the burst failure separately.

Related resources