Sha256: dfe2d77b48ce4f003d0ea2d8d5303d35cf454f3d0b62b1e216ef1c1c5be63700
Contents?: true
Size: 1.08 KB
Versions: 21
Compression:
Stored size: 1.08 KB
Contents
module RestFtpDaemon class Metrics def self.sample # Prepare external deps mem = GetProcessMem.new # Build final value return { system: { uptime: (Time.now - Conf.app_started).round(1), memory: mem.bytes.to_i, threads: Thread.list.count, }, jobs_by_status: RestFtpDaemon::JobQueue.instance.jobs_by_status, rate_by_pool: RestFtpDaemon::JobQueue.instance.rate_by(:pool), rate_by_targethost: RestFtpDaemon::JobQueue.instance.rate_by(:targethost), queued_by_pool: RestFtpDaemon::JobQueue.instance.queued_by_pool, workers_by_status: self.workers_count_by_status, } end private # Collect: workers by status def self.workers_count_by_status # Init counts = {} WorkerPool.instance.worker_variables.group_by do |wid, vars| vars[:status] end.each do |status, workers| counts[status] = workers.count end # Return count counts end end end
Version data entries
21 entries across 21 versions & 1 rubygems