Cryload::Stats::Batch - cryload 5.0.0

# class Cryload::Stats::Batch

- Cryload::Stats::Batch
- Reference
- Object

##
Overview

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

##
Defined in:

cryload/stats.cr

##
Constructors

- .new(success_status_ranges : Array(Range(Int32, Int32)) = [200..299])

##
Instance Method Summary

- #empty?
- #error_counts : Hash(String, Int64)
- #latency_buckets : Hash(Int32, Int64)
- #m2_latency_ms : Float64
- #max_request_time_ms : Float64
- #mean_latency_ms : Float64
- #min_request_time_ms : Float64
- #not_ok_requests : Int64
- #ok_requests : Int64
- #record_error(category : String)

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

- #record_response(time_taken_ms : Float64, status_code : Int32, response_bytes : Int64 = 0_i64)
- #response_count : Int64
- #status_code_counts : Hash(Int32, Int64)
- #total_request_count : Int64
- #total_request_time_ms : Float64
- #total_response_bytes : Int64
- #transport_error_count : Int64

##
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 #