quota


Description

{“what”:“Snapshot of external service quota limits and usage at a point in time.”,“why”:“Without it, there is no record of quota state to make decisions on.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:26:41.293300819+00:00”}

Columns

Column Type Size Nulls Auto Default Children Parents Comments
id bigserial 19 √ nextval('quota_id_seq'::regclass)

{“what”:“Unique numeric identifier for this quota snapshot row.”,“why”:“Provides a stable key for updates and joins; without it rows are indistinguishable.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:26:41.357562115+00:00”}

ts timestamptz 35,6 now()

{“what”:“UTC timestamp when this quota snapshot was recorded.”,“why”:“Orders snapshots over time; without it you cannot tell which reading is newest.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:26:41.384570808+00:00”}

from_service text 2147483647 'unknown'::text

{“what”:“Name of the external service this quota applies to, e.g. ‘openai’.”,“why”:“Separates quota rows per service; without it metrics from different services mix.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:26:41.437972465+00:00”}

rolling_5h_remaining int8 19 √ null

{“what”:“Number of requests/credits left in the rolling 5-hour window.”,“why”:“Shows current headroom; without it you cannot know if a request will be rejected.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:26:41.696502543+00:00”}

rolling_5h_max int8 19 √ null

{“what”:“Maximum requests/credits allowed in the rolling 5-hour window.”,“why”:“Provides the denominator to compute usage ratio; without it remaining is meaningless.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:26:41.925162883+00:00”}

rolling_5h_limited bool 1 √ null

{“what”:“True if the rolling 5-hour limit is currently active/enforced.”,“why”:“Distinguishes hard limits from soft warnings; without it you cannot tell if the limit is binding.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:26:42.133522460+00:00”}

subscription_limit int8 19 √ null

{“what”:“Total requests/credits allowed per subscription period.”,“why”:“Defines the cap for the subscription; without it you cannot compute subscription usage.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:26:42.170775868+00:00”}

subscription_requests int8 19 √ null

{“what”:“Number of requests/credits consumed in the current subscription period.”,“why”:“Shows consumption against subscription_limit; without it you cannot know remaining subscription quota.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:26:42.192348597+00:00”}

weekly_percent_remaining float8 17,17 √ null

{“what”:“Percentage (0-100) of weekly quota still available.”,“why”:“Gives a quick health check; without it you must compute from raw numbers.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:26:42.269587290+00:00”}

weekly_remaining_credits text 2147483647 √ null

{“what”:“Remaining weekly credits as a formatted string, e.g. ‘1,234’.”,“why”:“Preserves exact formatting from the provider; without it you lose the original display value.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:26:42.294791885+00:00”}

weekly_max_credits text 2147483647 √ null

{“what”:“Maximum weekly credits as a formatted string, e.g. ‘10,000’.”,“why”:“Provides the weekly cap in the provider’s format; without it you cannot compare to remaining.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:26:42.372564474+00:00”}

raw jsonb 2147483647 √ null

{“what”:“Unmodified JSON payload from the quota API response.”,“why”:“Retains fields not mapped to columns; without it future schema changes lose data.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:26:42.888468111+00:00”}

next_tick_at timestamptz 35,6 √ null

{“what”:“UTC timestamp when the quota window resets next.”,“why”:“Tells when limits will refresh; without it you cannot schedule retries or alerts.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:26:42.921137177+00:00”}

tick_percent float8 17,17 √ null

{“what”:“Fraction (0-1) of the current quota window that has elapsed.”,“why”:“Allows estimating how much time remains until next_tick_at; without it you cannot predict reset timing.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:26:43.003121495+00:00”}

Indexes

Constraint Name Type Sort Column(s)
quota_pkey Primary key Asc id
quota_remaining_ts_idx Performance Asc ts
quota_ts_idx Performance Desc ts

Relationships