Cost and Capacity
This page documents the cost controls visible in the non-GPU repositories. It does not quote a monthly bill or provider-unit price: those values change and must come from the billing consoles for the same reporting period.
Cost-bearing pathsโ
| Path | Primary meter | Repository control |
|---|---|---|
| Video upload | Storage bytes and operations | 2 GB request cap, owner-only paths, short-lived handoff URLs |
| Job orchestration | Function invocations, runtime, task delivery | entitlement gate, daily/monthly/concurrent quotas, bounded retries |
| Firestore | reads, writes, listeners | owner-scoped queries, server-only job writes, batched retention |
| Reports and exports | Storage and function runtime | 30-day completed-job retention, 7-day export retention |
| Public API/MCP | downloaded bytes, processing, function runtime | API-key balance reservation and per-key rate buckets |
| Email/notifications | extension/provider volume | server-only mail queue and event-driven sends |
Inference-provider cost is intentionally outside this audit. Correlate its billing data with Firestore job IDs rather than copying an estimate into this page.
Enforced limitsโ
requestUploadPathrequires an active entitlement or trial and enforces the user's monthly analysis allowance.- Upload quotas are reserved atomically. The current plan-key defaults are
free/trial
5 per day, 1 concurrent, pro50/3, and team200/5. - A failed or terminal job releases its concurrency slot idempotently.
- Cloud Tasks dispatch has three attempts with a 10-to-120-second backoff and five concurrent dispatch workers.
reconcileStuckJobsprevents abandoned jobs from holding quota forever.- Completed job artifacts are eligible for purge after 30 days; generated account-export bundles after seven days.
These are code defaults, not a promise to customers. Product entitlements also include tier/monthly limits and can be more restrictive.
Capacity checks before a launchโ
- Read current Firebase, Google Cloud, email, and external-provider billing dashboards for the same date range.
- Count accepted, failed, retried, and completed jobs by source.
- Compare Storage growth with the scheduled retention logs.
- Inspect quota rejections and task retries; a lower bill caused by rejected traffic is not healthy capacity.
- Load-test only in an isolated project with explicit spend limits.
Alerts worth maintainingโ
- spend-budget notifications in Google Cloud Billing;
- sustained growth in
pending,uploaded, orprocessingjobs; - task retry/exhaustion and function error rate;
- upload-quota rejection rate;
- retention sweep failures or a growing expired-artifact backlog;
- public API balance-refund failures.
Thresholds belong in the monitoring configuration and incident runbooks. Do not present planning thresholds as observed production baselines.
Source of truthโ
- Firebase and Google Cloud consoles: actual usage and spend.
acesense-auth-function/shared/config.ts: upload and retention constants.acesense-auth-function/shared/quota.ts: atomic quota accounting.acesense-auth-function/video/reconcile.ts: stale-job policy.acesense-auth-function/api/billing-meter.ts: public API metering.
See Observability for investigation paths.
Was this page helpful?