Operational Reliability Reports
Capacity Reserve Reliability
Classify Headroom
Capacity reports are easier to read when raw demand is paired with remaining reserve and a stable/watch/tight label. The selector changes only the demand value.
Program
Play the program to choose demand and inspect the reserve label.
capacity_reserve_reliability_report.dart
Replay: real traced execution (multi-file project)
String capacityLabel(int reserve) {
if (reserve >= 20) {
return 'stable';
}
if (reserve >= 10) {
return 'watch';
}
return 'tight';
}
void main() {
var demand = 72;
var capacity = 100;
var reserve = capacity - demand;
var status = capacityLabel(reserve);
var line = 'demand=$demand reserve=$reserve status=$status';
print(line);
}
String capacityLabel(int reserve) {
if (reserve >= 20) {
return 'stable';
}
if (reserve >= 10) {
return 'watch';
}
return 'tight';
}
void main() {
var demand = 88;
var capacity = 100;
var reserve = capacity - demand;
var status = capacityLabel(reserve);
var line = 'demand=$demand reserve=$reserve status=$status';
print(line);
}
String capacityLabel(int reserve) {
if (reserve >= 20) {
return 'stable';
}
if (reserve >= 10) {
return 'watch';
}
return 'tight';
}
void main() {
var demand = 95;
var capacity = 100;
var reserve = capacity - demand;
var status = capacityLabel(reserve);
var line = 'demand=$demand reserve=$reserve status=$status';
print(line);
}
demand ← 72
11void main() {12 var demand = 72;13 var capacity = 100;values this step72demandcapacity ← 100
12var demand = 72;13var capacity = 100;14var reserve = capacity - demand;values this step100capacityreserve ← 28
13var capacity = 100;14var reserve = capacity - demand;15var status = capacityLabel(reserve);values this step28reserve100capacity72demandcall ← capacityLabel(28)
14var reserve = capacity - demand;15var status = capacityLabel(reserve);16var line = 'demand=$demand reserve=$reserve status=$status';values this stepcapacityLabel(28)call28reservecondition ← true
1String capacityLabel(int reserve) {2 if (reserve >= 20) {3 return 'stable';values this steptruecondition28reservereturn ← stable
2if (reserve >= 20) {3 return 'stable';4}values this stepstablereturnstatus ← stable
14var reserve = capacity - demand;15var status = capacityLabel(reserve);16var line = 'demand=$demand reserve=$reserve status=$status';values this stepstablestatusline ← demand=72 reserve=28 status=stable
15var status = capacityLabel(reserve);16var line = 'demand=$demand reserve=$reserve status=$status';17print(line);values this stepdemand=72 reserve=28 status=stableline72demand28reservestablestatusprint(line);
16 var line = 'demand=$demand reserve=$reserve status=$status';17 print(line);18}outputdemand=72 reserve=28 status=stablevalues this stepdemand=72 reserve=28 status=stableline
demand ← 88
11void main() {12 var demand = 88;13 var capacity = 100;values this step88demandcapacity ← 100
12var demand = 88;13var capacity = 100;14var reserve = capacity - demand;values this step100capacityreserve ← 12
13var capacity = 100;14var reserve = capacity - demand;15var status = capacityLabel(reserve);values this step12reserve100capacity88demandcall ← capacityLabel(12)
14var reserve = capacity - demand;15var status = capacityLabel(reserve);16var line = 'demand=$demand reserve=$reserve status=$status';values this stepcapacityLabel(12)call12reservecondition ← false
1String capacityLabel(int reserve) {2 if (reserve >= 20) {3 return 'stable';values this stepfalsecondition12reservecondition ← true
4}5if (reserve >= 10) {6 return 'watch';values this steptruecondition12reservereturn ← watch
5if (reserve >= 10) {6 return 'watch';7}values this stepwatchreturnstatus ← watch
14var reserve = capacity - demand;15var status = capacityLabel(reserve);16var line = 'demand=$demand reserve=$reserve status=$status';values this stepwatchstatusline ← demand=88 reserve=12 status=watch
15var status = capacityLabel(reserve);16var line = 'demand=$demand reserve=$reserve status=$status';17print(line);values this stepdemand=88 reserve=12 status=watchline88demand12reservewatchstatusprint(line);
16 var line = 'demand=$demand reserve=$reserve status=$status';17 print(line);18}outputdemand=88 reserve=12 status=watchvalues this stepdemand=88 reserve=12 status=watchline
demand ← 95
11void main() {12 var demand = 95;13 var capacity = 100;values this step95demandcapacity ← 100
12var demand = 95;13var capacity = 100;14var reserve = capacity - demand;values this step100capacityreserve ← 5
13var capacity = 100;14var reserve = capacity - demand;15var status = capacityLabel(reserve);values this step5reserve100capacity95demandcall ← capacityLabel(5)
14var reserve = capacity - demand;15var status = capacityLabel(reserve);16var line = 'demand=$demand reserve=$reserve status=$status';values this stepcapacityLabel(5)call5reservecondition ← false
1String capacityLabel(int reserve) {2 if (reserve >= 20) {3 return 'stable';values this stepfalsecondition5reservecondition ← false
4}5if (reserve >= 10) {6 return 'watch';values this stepfalsecondition5reservereturn ← tight
7 }8 return 'tight';9}values this steptightreturnstatus ← tight
14var reserve = capacity - demand;15var status = capacityLabel(reserve);16var line = 'demand=$demand reserve=$reserve status=$status';values this steptightstatusline ← demand=95 reserve=5 status=tight
15var status = capacityLabel(reserve);16var line = 'demand=$demand reserve=$reserve status=$status';17print(line);values this stepdemand=95 reserve=5 status=tightline95demand5reservetightstatusprint(line);
16 var line = 'demand=$demand reserve=$reserve status=$status';17 print(line);18}outputdemand=95 reserve=5 status=tightvalues this stepdemand=95 reserve=5 status=tightline
reserve
`capacity - demand` turns the raw request level into remaining headroom.
threshold labels
`capacityLabel` maps reserve into `stable`, `watch`, or `tight`.
report row
The output keeps demand, reserve, and status in one row.