class JoobQ::QueueMetrics

Overview

Represents a class to handle queue metrics

Included Modules

Defined in:

joobq/queue_metrics.cr

Constructors

Instance Method Summary

Instance methods inherited from module JoobQ::MetricsProvider

global_metrics : Hash(String, Int64 | Float64) global_metrics

Constructor Detail

def self.instance : QueueMetrics #

[View source]
def self.new(instance_id : String = System.hostname) #

Initialize with a Redis client and unique instance ID


[View source]

Instance Method Detail

def aggregate_metrics(queue_name : String) : Hash(String, Int64 | Float64) #

Aggregate metrics across all instances for a particular queue


[View source]
def all_queue_metrics : Hash(String, Hash(String, String)) #

Modify this method to return a Hash instead of an Array


[View source]
def collect_and_store_metrics #

Collect and store queue metrics into Redis


[View source]
def global_metrics : Hash(String, Float64 | Int64) #

Aggregate metrics across all queues into a single hash


[View source]
def queue_metrics(queue_name : String) : Hash(String, String) #

Retrieve metrics for a specific queue


[View source]