work_stats
Creates, updates, deletes, gets or lists a work_stats resource.
Overview
| Name | work_stats |
| Type | Resource |
| Id | anthropic.environments.work_stats |
Fields
The following fields are returned by SELECT queries:
- get
| Name | Datatype | Description |
|---|---|---|
depth | integer | Number of work items waiting to be picked up (lag from consumer group) |
oldest_queued_at | string | RFC 3339 timestamp of oldest item in the work stream (includes both queued and pending items), null if stream empty |
pending | integer | Number of work items being processed (polled but not acknowledged) |
type | string | The type of object (work_queue_stats) |
workers_polling | integer | Number of workers that have polled for work in the last 30 seconds. Requires worker_id to be sent with poll requests. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | environment_id | Get statistics about the work queue for an environment. |
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 |
|---|---|---|
environment_id | string | (example: env_011CZkZ9X2dpNyB7HsEFoRfW) |
SELECT examples
- get
Get statistics about the work queue for an environment.
SELECT
depth,
oldest_queued_at,
pending,
type,
workers_polling
FROM anthropic.environments.work_stats
WHERE environment_id = '{{ environment_id }}' -- required
;