k6
Module to run k6 QA tests
Installation
dagger install github.com/prefapp/daggerverse/k6@927e13ecee3faffe3de053d49234422dfcf4ec01
Entrypoint
Return Type
K6
Example
dagger -m github.com/prefapp/daggerverse/k6@927e13ecee3faffe3de053d49234422dfcf4ec01 call \
func (m *MyModule) Example() *dagger.K6 {
return dag.
K6()
}
@function
def example() -> dagger.K6:
return (
dag.k6()
)
@func()
example(): K6 {
return dag
.k6()
}
Types
K6 🔗
throtthleCtr() 🔗
Return Type
Container !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
ctr | Container ! | - | Container to throttle |
networkThrottle | Integer ! | - | Bandwidth limit in megabytes per second |
networkInterface | String ! | - | Network interface to throttle |
Example
dagger -m github.com/prefapp/daggerverse/k6@927e13ecee3faffe3de053d49234422dfcf4ec01 call \
throtthle-ctr --ctr IMAGE:TAG --network-throttle integer --network-interface string
func (m *MyModule) Example(ctr *dagger.Container, networkThrottle int, networkInterface string) *dagger.Container {
return dag.
K6().
ThrotthleCtr(ctr, networkThrottle, networkInterface)
}
@function
def example(ctr: dagger.Container, network_throttle: int, network_interface: str) -> dagger.Container:
return (
dag.k6()
.throtthle_ctr(ctr, network_throttle, network_interface)
)
@func()
example(ctr: Container, networkThrottle: number, networkInterface: string): Container {
return dag
.k6()
.throtthleCtr(ctr, networkThrottle, networkInterface)
}
run() 🔗
Runs the k6 QA tests
Return Type
Container !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
workingDir | Directory ! | - | The working directory containing the script |
script | String ! | - | k6 Script file to execute |
env | [String ! ] | - | Environment variables to set |
vus | Integer | 1 | Virtual users to emulate |
duration | String | "1s" | Duration of the test |
networkThrottle | Integer | - | Bandwidth limit in megabytes per second |
networkInterface | String | "eth1" | Network interface to thorttle |
Example
dagger -m github.com/prefapp/daggerverse/k6@927e13ecee3faffe3de053d49234422dfcf4ec01 call \
run --working-dir DIR_PATH --script string
func (m *MyModule) Example(workingDir *dagger.Directory, script string) *dagger.Container {
return dag.
K6().
Run(workingDir, script)
}
@function
def example(working_dir: dagger.Directory, script: str) -> dagger.Container:
return (
dag.k6()
.run(working_dir, script)
)
@func()
example(workingDir: Directory, script: string): Container {
return dag
.k6()
.run(workingDir, script)
}