Cryload::Stats - cryload 5.0.0

# class Cryload::Stats

- Cryload::Stats
- Reference
- Object

##
Overview

Stats holder for the benchmark

##
Defined in:

cryload/stats.cr

##
Constant Summary

HISTOGRAM_BUCKET_COUNT = `((Math.log(HISTOGRAM_MAX_MS / HISTOGRAM_MIN_MS)) / HISTOGRAM_LOG_GROWTH).ceil.to_i + 1`
HISTOGRAM_GROWTH = `1.01`
HISTOGRAM_LOG_GROWTH = `Math.log(HISTOGRAM_GROWTH)`
HISTOGRAM_MAX_MS = `3600000.0`
HISTOGRAM_MIN_MS = `0.001`

  HDR-style logarithmic histogram: ~1% relative precision from 1µs to 1h in a few thousand buckets, instead of a dense linear bucket array.

TIME_IN_MILISECONDS = `1000`

##
Constructors

- .new(request_number : Int32, duration_mode : Bool = false, benchmark_start : Time::Instant = Time.instant, url : String = "", output_format : String = "text", success_status_ranges : Array(Range(Int32, Int32)) = [200..299], ci_thresholds : CiThresholds = CiThresholds.new, progress_enabled : Bool = false)

##
Class Method Summary

- .histogram_bucket_index(value_ms : Float64) : Int32
- .histogram_bucket_value(index : Int32) : Float64

  Geometric midpoint of the bucket, the best estimate for values in it.

##
Instance Method Summary

- #<<(request : Request)
- #average_bytes_per_response
- #average_request_time
- #benchmark_start : Time::Instant
- #bytes_per_second
- #ci_thresholds : Cryload::CiThresholds
- #csv_output
- #duration_mode : Bool
- #empty?
- #error_counts
- #failure_rate_percent
- #final_exit_code
- #json_output
- #latency_histogram_bins(bin_count : Int32 = 11)
- #latency_stdev
- #mark_benchmark_end
- #max_request_time
- #merge_batch(batch : Batch)
- #min_request_time
- #not_ok_requests
- #ok_requests
- #output_format : String
- #p10_request_time
- #p25_request_time
- #p50_request_time
- #p75_request_time
- #p90_request_time
- #p95_request_time
- #p999_request_time
- #p99_request_time
- #progress_enabled : Bool
- #quiet_output
- #record_error(category : String)
- #record_response(time_taken_ms : Float64, status_code : Int32, response_bytes : Int64 = 0_i64)
- #request_number : Int32
- #request_per_second

  Requests per second = total requests / wall clock time (actual throughput)

- #response_count
- #status_code_counts
- #success_status_ranges : Array(Range(Int32, Int32))
- #text_output?
- #total_request_count
- #total_request_time_in_seconds
- #total_response_bytes
- #transport_error_count
- #url : String
- #wall_clock_seconds

  Wall clock time from benchmark start to report completion.

##
Constructor Detail

def self.new(request_number : Int32, duration_mode : Bool = false, benchmark_start : Time::Instant = Time.instant, url : String = "", output_format : String = "text", success_status_ranges : Array(Range(Int32, Int32)) = [200..299], ci_thresholds : CiThresholds = CiThresholds.new, progress_enabled : Bool = false) #

##
Class Method Detail

def self.histogram_bucket_index(value_ms : Float64) : Int32 #
def self.histogram_bucket_value(index : Int32) : Float64 #

Geometric midpoint of the bucket, the best estimate for values in it.

##
Instance Method Detail

def <<(request : Request) #
def average_bytes_per_response #
def average_request_time #
def benchmark_start : Time::Instant #
def bytes_per_second #
def ci_thresholds : Cryload::CiThresholds #
def csv_output #
def duration_mode : Bool #
def empty? #
def error_counts #
def failure_rate_percent #
def final_exit_code #
def json_output #
def latency_histogram_bins(bin_count : Int32 = 11) #
def latency_stdev #
def mark_benchmark_end #
def max_request_time #
def merge_batch(batch : Batch) #
def min_request_time #
def not_ok_requests #
def ok_requests #
def output_format : String #
def p10_request_time #
def p25_request_time #
def p50_request_time #
def p75_request_time #
def p90_request_time #
def p95_request_time #
def p999_request_time #
def p99_request_time #
def progress_enabled : Bool #
def quiet_output #
def record_error(category : String) #
def record_response(time_taken_ms : Float64, status_code : Int32, response_bytes : Int64 = 0_i64) #
def request_number : Int32 #
def request_per_second #

Requests per second = total requests / wall clock time (actual throughput)

def response_count #
def status_code_counts #
def success_status_ranges : Array(Range(Int32, Int32)) #
def text_output? #
def total_request_count #
def total_request_time_in_seconds #
def total_response_bytes #
def transport_error_count #
def url : String #
def wall_clock_seconds #

Wall clock time from benchmark start to report completion.