class Cryload::Stats

Overview

Stats holder for the benchmark.

Defined in:

cryload/stats.cr

Constant Summary

PER_URL_LIMIT = 1000

Per-URL histograms are bounded: a cache-busting list of tens of thousands of URLs would spend more memory on the breakdown than the run is worth, and per-URL percentiles over a handful of samples each are meaningless.

PHASE_PERCENTILES = [50.0, 90.0, 95.0, 99.0, 99.9]
REPORT_PERCENTILES = [10.0, 25.0, 50.0, 75.0, 90.0, 95.0, 99.0, 99.9]

Constructors

Instance Method Summary

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, config : RunConfig = RunConfig.new, urls : Array(URI) = [] of URI) #

Instance Method Detail

def average_bytes_per_response : Float64 #

def benchmark_start : Time::Instant #

def breached_thresholds : Array(ThresholdResult) #

def bytes_per_second : Float64 #

def ci_thresholds : CiThresholds #

def config : RunConfig #

def corrected_latency_view : LatencyView #

def csv_output? : Bool #

def deadline : Time::Instant | Nil #

def duration_mode? : Bool #

def effective_latency_view : LatencyView #

The histogram the CI gates read: corrected unless the user turned correction off. Identical to the service histogram without --rate.


def empty? : Bool #

def error_breakdown : Array(ErrorEntry) #

def exit_code : ExitCode #

def failure_flags_breached? : Bool #

def failure_rate_percent : Float64 #

def json_output? : Bool #

def latency_histogram_bins(bin_count : Int32 = 11) #

def latency_view : LatencyView #

def mark_benchmark_end(at : Time::Instant = Time.instant) : Nil #

def merge_batch(batch : Batch) : Nil #

def new_batch : Batch #

def not_ok_requests : Int64 #

def ok_requests : Int64 #

def output_format : String #

def phase_views : Hash(String, LatencyView) #

def progress_enabled? : Bool #

def quiet_output? : Bool #

def rate_report : RateReport #

def record(sample : Sample) : Nil #

def record_error(category : String, message : String | Nil = nil, url_index : Int32 = 0) : Nil #

def request_number : Int32 #

def request_per_second : Float64 #

def response_count : Int64 #

def send_delay_view : LatencyView #

def start_benchmark_window : Nil #

Warmup runs before the timed window; v5 started the clock before warmup, which deflated throughput and shortened the duration window by the warmup length.


def status_breakdown : Array(StatusEntry) #

def status_code_counts : Hash(Int32, Int64) #

def success_status_ranges : Array(Range(Int32, Int32)) #

def target_unreachable? : Bool #

def text_output? : Bool #

def threshold_results : Array(ThresholdResult) #

def total_request_count : Int64 #

def total_response_bytes : Int64 #

def track_urls? : Bool #

def transport_error_count : Int64 #

def url : String #

def url_breakdown : Array(UrlEntry) | Nil #

def urls : Array(URI) #

def wall_clock_seconds : Float64 #