workspace_usage_totals
Creates, updates, deletes, gets or lists a workspace_usage_totals resource.
Overview​
| Name | workspace_usage_totals |
| Type | Resource |
| Id | railway.billing.workspace_usage_totals |
Fields​
The following fields are returned by SELECT queries:
- list
One row per AggregatedUsage. The aggregated usage of a single measurement.
| Name | Datatype | Description |
|---|---|---|
measurement | string | The measurement that was aggregated. (AGENT_CACHE_READ_TOKENS, AGENT_CACHE_WRITE_TOKENS, AGENT_INPUT_TOKENS, AGENT_OUTPUT_TOKENS, AGENT_SPEND_USD, BACKUP_USAGE_GB, CPU_LIMIT, CPU_USAGE, CPU_USAGE_2, DISK_USAGE_GB, EPHEMERAL_DISK_USAGE_GB, MEASUREMENT_UNSPECIFIED, MEMORY_LIMIT_GB, MEMORY_USAGE_GB, NETWORK_RX_GB, NETWORK_TX_GB, UNRECOGNIZED) |
tags | object | The tags that were used to group the metric. Only the tags that were used in the groupBy will be present. |
value | number | The aggregated value. |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | measurements | end_date, include_deleted, start_date, workspace_id | Workspace-wide SUM of the same UI usage rollup as usage grouped by project. Use this for the usage-page header so it does not wait on per-project rows. Deleted projects that still bill are included when includeDeleted is true. Backed by the Railway GraphQL query workspaceUsageTotals. |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
measurements | string | GraphQL list literal of MetricMeasurement values, for example [AGENT_CACHE_READ_TOKENS, AGENT_CACHE_WRITE_TOKENS]. |
end_date | string (date-time) | |
include_deleted | boolean | Whether to include deleted projects in the usage. |
start_date | string (date-time) | |
workspace_id | string |
SELECT examples​
- list
Workspace-wide SUM of the same UI usage rollup as usage grouped by project. Use this for the usage-page header so it does not wait on per-project rows. Deleted projects that still bill are included when includeDeleted is true. Backed by the Railway GraphQL query workspaceUsageTotals.
SELECT
measurement,
tags,
value
FROM railway.billing.workspace_usage_totals
WHERE measurements = '{{ measurements }}' -- required
AND end_date = '{{ end_date }}'
AND include_deleted = '{{ include_deleted }}'
AND start_date = '{{ start_date }}'
AND workspace_id = '{{ workspace_id }}'
;