Class: Sidekiq::Mcp::Tools::SidekiqStatsTool

Inherits:
Sidekiq::Mcp::Tool show all
Defined in:
lib/sidekiq/mcp/tools/sidekiq_stats_tool.rb

Instance Method Summary collapse

Methods inherited from Sidekiq::Mcp::Tool

arguments, #call, description, schema_to_json_schema, to_tool_definition

Instance Method Details

#performObject



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/sidekiq/mcp/tools/sidekiq_stats_tool.rb', line 16

def perform
  stats = Sidekiq::Stats.new
  {
    processed: stats.processed,
    failed: stats.failed,
    busy: stats.workers_size,
    enqueued: stats.enqueued,
    scheduled: stats.scheduled_size,
    retry: stats.retry_size,
    dead: stats.dead_size,
    default_queue_latency: stats.default_queue_latency
  }.to_json
end