oct
Loading...
Searching...
No Matches
oct.timing.tiers Namespace Reference

Functions

str|None tier_for (object stage)
dict[str, int|None] budgets_ms (object overrides=None)
int|None budget_for (object stage, Mapping[str, int|None]|None budgets=None)

Variables

str INNER_LOOP = "inner_loop"
str PER_COMMIT = "per_commit"
str PER_LANDING = "per_landing"
str PERIODIC = "periodic"
Mapping TIER_BUDGETS_MS
dict _STAGES_BY_TIER
Mapping STAGE_TIERS

Detailed Description

Purpose
-------
Declare each timed stage's cost-of-quality tier and that tier's budget.

Responsibilities
----------------
- Keep local timing data bounded, private and advisory.

Diagnostics
-----------
Domain: GENERAL
Levels:
    L1 -- instrumentation failures
    L2 -- lifecycle
    L3 -- semantic details
    L4 -- deep tracing

Contracts
---------
- Timing instrumentation never changes the wrapped operation's outcome.
- A project may lower a shipped tier budget and never raise one.

Dependencies
------------
- oc_diagnostics (structured timing diagnostics)

Function Documentation

◆ budget_for()

int | None oct.timing.tiers.budget_for ( object stage,
Mapping[str, int | None] | None budgets = None )
Return the effective budget, or None when the stage declares no tier.

Definition at line 92 of file tiers.py.

Here is the call graph for this function:

◆ budgets_ms()

dict[str, int | None] oct.timing.tiers.budgets_ms ( object overrides = None)
Apply project overrides, which may only lower a shipped budget.

Definition at line 78 of file tiers.py.

◆ tier_for()

str | None oct.timing.tiers.tier_for ( object stage)
Return the declared tier, never inventing one for an unknown stage.

Definition at line 74 of file tiers.py.

Here is the caller graph for this function:

Variable Documentation

◆ _STAGES_BY_TIER

dict oct.timing.tiers._STAGES_BY_TIER
protected
Initial value:
1= {
2 INNER_LOOP: ("format", "health", "lint", "new", "oct"),
3 PER_COMMIT: ("git", "git.add", "git.branch", "git.check", "git.commit",
4 "git.commit-msg", "git.ignore", "git.restore", "git.status"),
5 PER_LANDING: ("agent", "audit", "clean", "complexity", "deps", "docs",
6 "engine.dispatch", "engine.prepare", "engine.teardown",
7 "export-skeleton", "export-source", "git.changelog", "test",
8 "typecheck"),
9 PERIODIC: ("diag", "diag.list-domains", "diag.migrate-config",
10 "diag.restore", "diag.set-level", "diag.validate-config",
11 "git.hooks", "git.hooks.install", "git.hooks.remove",
12 "git.hooks.status", "git.init", "install", "install-hooks",
13 "install-mcp", "migrate", "migrate.option-c", "mutate",
14 "scaffold"),
15}

Definition at line 55 of file tiers.py.

◆ INNER_LOOP

str oct.timing.tiers.INNER_LOOP = "inner_loop"

Definition at line 38 of file tiers.py.

◆ PER_COMMIT

str oct.timing.tiers.PER_COMMIT = "per_commit"

Definition at line 39 of file tiers.py.

◆ PER_LANDING

str oct.timing.tiers.PER_LANDING = "per_landing"

Definition at line 40 of file tiers.py.

◆ PERIODIC

str oct.timing.tiers.PERIODIC = "periodic"

Definition at line 41 of file tiers.py.

◆ STAGE_TIERS

Mapping oct.timing.tiers.STAGE_TIERS
Initial value:
1= MappingProxyType(
2 {stage: tier for tier, stages in _STAGES_BY_TIER.items() for stage in stages})

Definition at line 71 of file tiers.py.

◆ TIER_BUDGETS_MS

Mapping oct.timing.tiers.TIER_BUDGETS_MS
Initial value:
1= MappingProxyType({
2 INNER_LOOP: 10_000,
3 PER_COMMIT: 30_000,
4 PER_LANDING: 900_000,
5 PERIODIC: None,
6})

Definition at line 45 of file tiers.py.