关于「检测器:累积和、指数加权与错误预算」,《手机指挥容器集群》给出的定量结论是什么?

结论:第二章比较固定阈值、累积和与指数加权,并把告警挂在错误预算上:目标 0.999 时每月只有 43.2 分钟全停预算。

数据口径:书中参数为示意;全部计算由书中程序生成;本书是非个人化经营建议,不承诺任何可用性数字,只写书、不连接任何机器。 书中以标注框区分已发表的证据、可运行的 Python 计算(22 段程序)、原典与作者的假说。

English version

对照数据表

下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 43.2

budget 43.2 min of full outage; fast burn threshold 14.4 x
error shareminutesbudget usedalert at minute
1.020.0461
1.0100.2311
1.0451.0421
0.05300.03518
0.051200.13918
0.3200.1393
0.0026000.028none
查看完整验算程序
# Chapter 2. p23: alert on the error budget, not on every blip
# Availability target 0.999 over 30 days. Burn rate = observed error
# share / (1 - target). An alert on a 1-hour window fires when that
# hour alone would spend 2 % of the monthly budget. Incidents below
# are illustrative (error share, minutes); the check runs every minute.
import math

TARGET, DAYS = 0.999, 30
BUDGET_MIN = DAYS * 24 * 60 * (1.0 - TARGET)
FAST = 0.02 * DAYS * 24 / 1.0
WIN = 60


def first_alert(share, minutes):
    """Minute at which the 1-hour mean burn rate first reaches FAST."""
    errs = []
    for t in range(1, minutes + WIN + 1):
        errs.append(share if t <= minutes else 0.0)
        window = errs[-WIN:]
        burn = math.fsum(window) / WIN / (1.0 - TARGET)
        if burn >= FAST:
            return t
    return None


print("budget {:.1f} min of full outage; fast burn threshold {:.1f} x".format(
    BUDGET_MIN, FAST))
print("error share  minutes  budget used  alert at minute")
for share, minutes in ((1.0, 2), (1.0, 10), (1.0, 45), (0.05, 30),
                       (0.05, 120), (0.3, 20), (0.002, 600)):
    used = share * minutes / BUDGET_MIN
    hit = first_alert(share, minutes)
    print("{:<11}  {:>7}  {:>11.3f}  {:>15}".format(
        share, minutes, used, "none" if hit is None else hit))

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《移动终端单手遥控多容器集群、异常中断推送滤波与离席零停摆指挥母典》第 2 章「检测器:累积和、指数加权与错误预算」(版本 1.0.0). 5D Library. DOI 待发布

DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-416 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026416,
  author    = {Fan, Yafu},
  title     = {Pocket Command of Multi-Container Fleets: Mobile Remote Control, Exception-Only Push Filtering and Away-From-Keyboard Continuity},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

本书其他章节结论