carlos / platform Public

Clone
git clone https://amadan.net/carlos/platform

Plain git — no account needed to clone.

Download

Download this file

1package usage
2
3// AppStorage is one app's occupancy on one day: deployment-bucket bytes
4// under the app's prefix, plus its tenant object-store bucket when one is
5// provisioned. StoreProvisioned distinguishes an empty provisioned store from
6// no store; StoreUnswept marks a store the pass could not size (bad
7// credentials, endpoint down) — the dashboard must show "unswept", never 0.
8type AppStorage struct {
9 BucketBytes int64 `json:"bucket_bytes"`
10 StoreBytes int64 `json:"store_bytes,omitempty"`
11 StoreUnswept bool `json:"store_unswept,omitempty"`
12 StoreProvisioned bool `json:"store_provisioned"`
13}
14
15// StorageDay is usage/storage/<date>.json, keyed "<acct>/<app>".
16type StorageDay struct {
17 V int `json:"v"` // 1
18 Date string `json:"date"`
19 Apps map[string]AppStorage `json:"apps"`
20}
21
22// StorageDayKey is the bucket key for a day's storage sweep.
23func StorageDayKey(date string) string { return "usage/storage/" + date + ".json" }
24
25// StoragePrefix is the List prefix for storage days.
26const StoragePrefix = "usage/storage/"
27