Class: Puma::Plugin::Telemetry::WorkerData

Inherits:
Object
  • Object
show all
Includes:
CommonData
Defined in:
lib/puma/plugin/telemetry/data.rb

Overview

Handles the case of non clustered mode, where ‘workers` isn’t configured

Constant Summary

Constants included from CommonData

CommonData::TELEMETRY_TO_METHODS

Instance Method Summary collapse

Methods included from CommonData

#initialize, #metrics, #workers_booted, #workers_total

Instance Method Details

#queue_backlogObject



55
56
57
# File 'lib/puma/plugin/telemetry/data.rb', line 55

def queue_backlog
  @stats.fetch(:backlog, 0)
end

#queue_capacityObject



59
60
61
# File 'lib/puma/plugin/telemetry/data.rb', line 59

def queue_capacity
  @stats.fetch(:pool_capacity, 0)
end

#workers_max_threadsObject



43
44
45
# File 'lib/puma/plugin/telemetry/data.rb', line 43

def workers_max_threads
  @stats.fetch(:max_threads, 0)
end

#workers_requests_countObject



47
48
49
# File 'lib/puma/plugin/telemetry/data.rb', line 47

def workers_requests_count
  @stats.fetch(:requests_count, 0)
end

#workers_spawned_threadsObject



51
52
53
# File 'lib/puma/plugin/telemetry/data.rb', line 51

def workers_spawned_threads
  @stats.fetch(:running, 0)
end