class Cryload::Stats::Batch

Overview

Worker-local stats batch flushed periodically to the global collector.

Defined in:

cryload/stats.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(success_status_ranges : Array(Range(Int32, Int32)) = [200..299]) #

Instance Method Detail

def empty? #

def error_counts : Hash(String, Int64) #

def latency_buckets : Hash(Int32, Int64) #

def m2_latency_ms : Float64 #

def max_request_time_ms : Float64 #

def mean_latency_ms : Float64 #

def min_request_time_ms : Float64 #

def not_ok_requests : Int64 #

def ok_requests : Int64 #

def record_error(category : String) #

Transport errors are excluded from latency metrics: connect failures (~0 ms) and timeouts would otherwise skew the percentiles.


def record_response(time_taken_ms : Float64, status_code : Int32, response_bytes : Int64 = 0_i64) #

def response_count : Int64 #

def status_code_counts : Hash(Int32, Int64) #

def total_request_count : Int64 #

def total_request_time_ms : Float64 #

def total_response_bytes : Int64 #

def transport_error_count : Int64 #