Skip to main content

work_stats

Creates, updates, deletes, gets or lists a work_stats resource.

Overview

Namework_stats
TypeResource
Idanthropic.environments.work_stats

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
depthintegerNumber of work items waiting to be picked up (lag from consumer group)
oldest_queued_atstringRFC 3339 timestamp of oldest item in the work stream (includes both queued and pending items), null if stream empty
pendingintegerNumber of work items being processed (polled but not acknowledged)
typestringThe type of object (work_queue_stats)
workers_pollingintegerNumber 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:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectenvironment_idGet 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.

NameDatatypeDescription
environment_idstring (example: env_011CZkZ9X2dpNyB7HsEFoRfW)

SELECT examples

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
;