module Cryload

Overview

Command Line Interface Handler for Cryload

Defined in:

cryload/ci_thresholds.cr
cryload/cli.cr
cryload/cli_options.cr
cryload/cli_validator.cr
cryload/duration.cr
cryload/error_category.cr
cryload/fd_limit.cr
cryload/histogram.cr
cryload/http_client.cr
cryload/load_generator.cr
cryload/logger.cr
cryload/phased_client.cr
cryload/rate_limiter.cr
cryload/request.cr
cryload/shutdown_coordinator.cr
cryload/stats.cr
cryload/version.cr

Constant Summary

DEFAULT_MAX_REDIRECTS = 5
MACOS_SYSTEM_CA_BUNDLE = "/etc/ssl/cert.pem"

macOS system CA bundle, used as a fallback when OpenSSL's compiled-in default certificate path (e.g. a Homebrew OPENSSLDIR baked into a statically linked libcrypto) does not exist on the user's machine.

VERSION = {{ (`shards version /build/cryload/src/cryload-6.0.0/src/cryload/../..`).strip.stringify }}

Class Method Summary

Class Method Detail

def self.clone_headers(headers : HTTP::Headers) : HTTP::Headers #

HTTP::Request mutates the headers object it is handed (Host, Content-Length), so every worker needs its own copy once the load fibers run in parallel.


def self.connect_request(uri : URI, port : Int32, proxy : URI) : String #

def self.create_direct_http_client(uri, timeouts : Timeouts = Timeouts.new, insecure : Bool = false) : PhasedClient #

def self.create_http_client(uri, timeouts : Timeouts = Timeouts.new, insecure : Bool = false, proxy : URI | Nil = nil) : PhasedClient #

def self.create_http_proxy_client(uri, proxy : URI, timeouts : Timeouts = Timeouts.new, insecure : Bool = false) : PhasedClient #

def self.create_https_proxy_client(uri, proxy : URI, timeouts : Timeouts = Timeouts.new, insecure : Bool = false) : PhasedClient #

def self.create_stats(request_number, 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) #

def self.default_tls_context : OpenSSL::SSL::Context::Client #

def self.display_url(urls : Array(URI)) : String #

def self.effective_port(uri : URI) : Int32 #

def self.elapsed_ms(since : Time::Instant) : Float64 #

def self.load_urls_from_file(path : String) : Array(URI) #

def self.proxy_authorization(proxy : URI) : String | Nil #

def self.proxy_request_target(uri : URI) : String #

def self.read_proxy_connect_status(socket : IO) : Int32 #

def self.stats : Stats #

def self.stats? : Stats | Nil #

Nil until the run is configured, so the signal handler can fire before the load generator exists without blowing up.


def self.tls_context_for(uri : URI, insecure : Bool) #