pub struct K6ScriptTemplateData {Show 18 fields
pub base_url: String,
pub stages: Vec<K6StageData>,
pub operations: Vec<K6OperationData>,
pub threshold_percentile: String,
pub threshold_ms: u64,
pub max_error_rate: f64,
pub scenario_name: String,
pub skip_tls_verify: bool,
pub has_dynamic_values: bool,
pub dynamic_imports: Vec<String>,
pub dynamic_globals: Vec<String>,
pub security_testing_enabled: bool,
pub has_custom_headers: bool,
pub chunked_request_bodies: bool,
pub target_rps: Option<u32>,
pub no_keep_alive: bool,
pub duration_secs: u64,
pub max_vus: u32,
}Expand description
Typed template data for k6_script.hbs.
Every field referenced by {{variable}} or {{#if flag}} in the template
is a required field here, so the compiler prevents the Issue-#79 class of
bugs (template rendered with missing data).
Fields§
§base_url: String§stages: Vec<K6StageData>§operations: Vec<K6OperationData>§threshold_percentile: String§threshold_ms: u64§max_error_rate: f64§scenario_name: String§skip_tls_verify: bool§has_dynamic_values: bool§dynamic_imports: Vec<String>§dynamic_globals: Vec<String>§security_testing_enabled: bool§has_custom_headers: bool§chunked_request_bodies: boolWhen true, emit Transfer-Encoding: chunked on every request that has a
body. NOTE: k6 runs on Go’s net/http, which decides chunking based on
the body type — a string body has a known length and Go will normally
send Content-Length. Setting this header explicitly is the closest
k6-script-level approximation; for true raw chunked traffic, prefer
curl --data-binary @file -H "Transfer-Encoding: chunked" or a custom
hyper/reqwest harness.
target_rps: Option<u32>Optional target RPS. When Some(n), the script switches the executor
from ramping-vus to constant-arrival-rate at n requests/sec.
Issue #79.
no_keep_alive: boolWhen true, the generated script sets noConnectionReuse: true on every
request so each one opens a fresh TCP/TLS connection. Used to drive
connections-per-second load. Issue #79.
duration_secs: u64Total test duration in seconds. Used by the constant-arrival-rate
executor (when target_rps is set) which needs a single duration
rather than a list of stages. Issue #79 — Srikanth’s round-5 reply:
--rps was previously deriving duration from the last stage of the
chosen scenario; under ramp-up (the default) the last stage has
target: 0, which gave preAllocatedVUs: 0 and 0 requests.
max_vus: u32Max VUs to pre-allocate for the constant-arrival-rate executor.
Issue #79 (round 5).
Trait Implementations§
Source§impl Clone for K6ScriptTemplateData
impl Clone for K6ScriptTemplateData
Source§fn clone(&self) -> K6ScriptTemplateData
fn clone(&self) -> K6ScriptTemplateData
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for K6ScriptTemplateData
impl Debug for K6ScriptTemplateData
Auto Trait Implementations§
impl Freeze for K6ScriptTemplateData
impl RefUnwindSafe for K6ScriptTemplateData
impl Send for K6ScriptTemplateData
impl Sync for K6ScriptTemplateData
impl Unpin for K6ScriptTemplateData
impl UnsafeUnpin for K6ScriptTemplateData
impl UnwindSafe for K6ScriptTemplateData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more