MCPcopy Create free account
hub / github.com/PostHog/duckgres / ComputeUsageRow

Struct ComputeUsageRow

controlplane/configstore/compute_usage.go:36–45  ·  view source on GitHub ↗

ComputeUsageRow is one aggregated row served by the billing pull API: the sum of every closed bucket for one key on one UTC day. CPU and MemGiB are the exact NUMERIC decimal texts (e.g. "8", "1.5", "0.5") carried as json.Number so they serialize as unquoted JSON numbers with full precision.

Source from the content-addressed store, hash-verified

34// the exact NUMERIC decimal texts (e.g. "8", "1.5", "0.5") carried as
35// json.Number so they serialize as unquoted JSON numbers with full precision.
36type ComputeUsageRow struct {
37 Date string `json:"date"`
38 OrgID string `json:"org_id"`
39 TeamID int64 `json:"team_id"`
40 QuerySource string `json:"query_source"`
41 CPU json.Number `json:"cpu"`
42 MemGiB json.Number `json:"mem_gib"`
43 CPUSeconds int64 `json:"cpu_seconds"`
44 MemorySeconds int64 `json:"memory_seconds"`
45}
46
47// milliUnitDecimal renders value/denom as an exact decimal string with no
48// trailing zeros, using integer math only. denom must divide a power of 10

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected