Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

K6Resource

Handle
📦 CommunityToolkit.Aspire.Hosting.k6 v13.6.1

A resource that represents a Grafana k6 instance

type K6Resource interface {
IComputeResource
Resource
ResourceWithArgs
ResourceWithEndpoints
ResourceWithEnvironment
ResourceWithWaitSupport
}

Properties

propertyPrimaryEndpointEndpointReferenceget
Gets the primary endpoint for the Grafana k6 instance. This endpoint is used for all API calls over HTTP.
PrimaryEndpoint() EndpointReference

Methods

Set K6 environment variables from the existing OTEL environment set for this resource. See https://grafana.com/docs/k6/latest/results-output/real-time/opentelemetry/#configuration.
WithK6OtlpEnvironment() K6Resource
K6Resource

The IResourceBuilder.

Returns a handle; failures surface later via Err().

methodWithScriptbuilder
Runs a k6 JS script when starting the Grafana k6 container resource.
WithScript(
scriptPath string,
options ...*WithScriptOptions,
) K6Resource
scriptPathstringThe path to the JS script to run.
options...*WithScriptOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithScriptOptions argument.

VirtualUsers*float64The number of virtual users for the test..
Duration*stringThe duration of the test, e.g. 30s.
SummaryMode*K6SummaryModeThe summary mode of the test execution.
K6Resource

The IResourceBuilder.

Returns a handle; failures surface later via Err().