Get Queue Statistics
client.Beta.Environments.Work.Stats(ctx, environmentID, query) (*BetaSelfHostedWorkQueueStats, error)GET/v1/environments/{environment_id}/work/stats
Get Queue Statistics
package main
import (
"context"
"fmt"
"github.com/anthropics/anthropic-sdk-go"
"github.com/anthropics/anthropic-sdk-go/option"
)
func main() {
client := anthropic.NewClient(
option.WithAPIKey("my-anthropic-api-key"),
)
betaSelfHostedWorkQueueStats, err := client.Beta.Environments.Work.Stats(
context.TODO(),
"env_011CZkZ9X2dpNyB7HsEFoRfW",
anthropic.BetaEnvironmentWorkStatsParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", betaSelfHostedWorkQueueStats.Depth)
}{
"depth": 0,
"oldest_queued_at": "oldest_queued_at",
"pending": 0,
"type": "work_queue_stats",
"workers_polling": 0
}Returns Examples
{
"depth": 0,
"oldest_queued_at": "oldest_queued_at",
"pending": 0,
"type": "work_queue_stats",
"workers_polling": 0
}