Skip to content

Commit

Permalink
REBRANDING: speedboat -> k6
Browse files Browse the repository at this point in the history
  • Loading branch information
uppfinnarn committed Dec 1, 2016
1 parent 7e48a44 commit 5af667a
Show file tree
Hide file tree
Showing 50 changed files with 264 additions and 264 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
speedboat
k6
samples
web/dist
web/tmp
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/speedboat
/k6
/web/bower_components
/web/node_modules
/web/dist/*
Expand Down
2 changes: 1 addition & 1 deletion API.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ log

Writes out a log message.

Type is one of `debug`, `info`, `warn` and `error`; messages to unknown channels will be ignored. Note that `debug` messages are only displayed when running speedboat with `-v` (`--verbose`).
Type is one of `debug`, `info`, `warn` and `error`; messages to unknown channels will be ignored. Note that `debug` messages are only displayed when running k6 with `-v` (`--verbose`).

Extra is an object of extra data to be provided along with the message. It's considered good practice to have the message a fixed string, and use extra data to provide context information, rather than concatenating it with the message.

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM golang:1.7

# Add the sources
WORKDIR /go/src/github.com/loadimpact/speedboat
WORKDIR /go/src/github.com/loadimpact/k6
ADD . .

# Build the binary
Expand All @@ -22,4 +22,4 @@ RUN curl -sL https://deb.nodesource.com/setup_6.x | bash && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

WORKDIR /
ENTRYPOINT ["/go/bin/speedboat"]
ENTRYPOINT ["/go/bin/k6"]
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ docs:

.PHONY: container
container:
docker build --rm --pull --no-cache -t loadimpact/speedboat:$(VERSION) .
docker build --rm --pull --no-cache -t loadimpact/k6:$(VERSION) .

.PHONY: push
push:
docker push loadimpact/speedboat:$(VERSION)
docker push loadimpact/k6:$(VERSION)
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Speedboat
k6
=========

Speedboat is the codename for the next generation of [Load Impact](https://loadimpact.com/)'s load generator.
k6 is the codename for the next generation of [Load Impact](https://loadimpact.com/)'s load generator.

It features a modern codebase built on [Go](https://golang.org/) and integrates ES6, the latest iteration of Javascript, as a scripting language.

Expand All @@ -10,7 +10,7 @@ The simplest possible load script would be something along these lines:
```es6
// The script API is provided as ES6 modules, no global namespace pollution.
// If you prefer the older style of doing things, you may also use require().
import http from "speedboat/http";
import http from "k6/http";

// Export your test code as a 'default' function.
export default function() {
Expand All @@ -22,56 +22,56 @@ export default function() {
To run it, simply do...

```
speedboat run script.js
k6 run script.js
```

Installation
------------

There are a couple of ways to set up Speedboat:
There are a couple of ways to set up k6:

1. The **recommended way** to get started is to grab a binary release from [the releases page](https://github.com/loadimpact/speedboat/releases). Either copy/link the `speedboat` binary somewhere in your `$PATH`, or use it as:
1. The **recommended way** to get started is to grab a binary release from [the releases page](https://github.com/loadimpact/k6/releases). Either copy/link the `k6` binary somewhere in your `$PATH`, or use it as:

```sh
./speedboat run myscript.js
./k6 run myscript.js
```

1. If you're comfortable using Docker, you may use that as well:

```sh
docker pull loadimpact/speedboat
docker run --rm --net=host -v myscript.js:/myscript.js loadimpact/speedboat run /myscript.js
docker pull loadimpact/k6
docker run --rm --net=host -v myscript.js:/myscript.js loadimpact/k6 run /myscript.js
```

It's recommended to run speedboat with `--net=host` as it slightly improves network throughput, and causes container ports to be accessible on the host without explicit exposure. Note that this means opting out of the network isolation normally provided to containers, refer to [the Docker manual](https://docs.docker.com/v1.8/articles/networking/#how-docker-networks-a-container) for more information.
It's recommended to run k6 with `--net=host` as it slightly improves network throughput, and causes container ports to be accessible on the host without explicit exposure. Note that this means opting out of the network isolation normally provided to containers, refer to [the Docker manual](https://docs.docker.com/v1.8/articles/networking/#how-docker-networks-a-container) for more information.

1. If you have a Go environment [set up](https://golang.org/doc/install), you may simply use `go get`:

```sh
go get github.com/loadimpact/speedboat
go get github.com/loadimpact/k6
```

Use `go get -u` to pull down updates.

Usage
-----

Speedboat works with the concept of "virtual users", or "VUs". A VU is essentially a glorified `while (true)` loop that runs a script over and over and reports stats or errors generated.
k6 works with the concept of "virtual users", or "VUs". A VU is essentially a glorified `while (true)` loop that runs a script over and over and reports stats or errors generated.

Let's say you've written a script called `myscript.js` (you can copy the one from the top of this page), and you want to run it with 100 VUs for 30 seconds. You'd do something like this:

```sh
speedboat run -u 100 -d 30s myscript.js
k6 run -u 100 -d 30s myscript.js
```

The first thing you might notice is that the duration is written "30s", not "30". This is because we're using Go's duration notation, which means `90s`, `1m30s`, `24h` and `2d` are all valid durations, and much more readable than if you had to convert everything to seconds.

The second thing you might notice (or maybe not, if you're just reading this) is that Speedboat doesn't actually exit immediately after the test finishes. There's a flag to make it (`-q`/`--quit`), but there's a reason for this: it exposes a full-fledged web UI on [http://localhost:6565/](http://localhost:6565/) (by default), which shows realtime statistics and errors.
The second thing you might notice (or maybe not, if you're just reading this) is that k6 doesn't actually exit immediately after the test finishes. There's a flag to make it (`-q`/`--quit`), but there's a reason for this: it exposes a full-fledged web UI on [http://localhost:6565/](http://localhost:6565/) (by default), which shows realtime statistics and errors.

But that's not the only thing it does. It also exposes a REST API on the same port for controlling test execution, which you can call yourself with an HTTP client of your choice (curl, httpie, ...), or using the commandline wrappers - essentially every speedboat command aside from `run` wraps an API call. For example, this will scale the running test down to 50 VUs:
But that's not the only thing it does. It also exposes a REST API on the same port for controlling test execution, which you can call yourself with an HTTP client of your choice (curl, httpie, ...), or using the commandline wrappers - essentially every k6 command aside from `run` wraps an API call. For example, this will scale the running test down to 50 VUs:

```sh
speedboat scale 50
k6 scale 50
```

This is a quite powerful feature when combined with options like `-d 0` / `--duration 0`, which causes the test to run indefinitely until told otherwise. You're fully in control of how your test is executed!
Expand Down
120 changes: 60 additions & 60 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,71 +2,71 @@
# vi: set ft=ruby :

Vagrant.configure(2) do |config|
config.vm.box = "boxcutter/ubuntu1604"
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.box = "boxcutter/ubuntu1604"
config.vm.synced_folder ".", "/vagrant", disabled: true

config.vm.define "loadgen", primary: true do |loadgen|
loadgen.vm.provider "virtualbox" do |vb|
vb.memory = 2048
vb.cpus = 2
end
loadgen.vm.hostname = "loadgen"
loadgen.vm.network "private_network", ip: "172.16.0.2"
config.vm.define "loadgen", primary: true do |loadgen|
loadgen.vm.provider "virtualbox" do |vb|
vb.memory = 2048
vb.cpus = 2
end
loadgen.vm.hostname = "loadgen"
loadgen.vm.network "private_network", ip: "172.16.0.2"

loadgen.vm.synced_folder "external/salt", "/srv/salt", type: "rsync"
loadgen.vm.synced_folder "external/pillar", "/srv/pillar", type: "rsync"
loadgen.vm.synced_folder ".", "/home/vagrant/go/src/github.com/loadimpact/speedboat", type: "rsync"
loadgen.vm.synced_folder "external/salt", "/srv/salt", type: "rsync"
loadgen.vm.synced_folder "external/pillar", "/srv/pillar", type: "rsync"
loadgen.vm.synced_folder ".", "/home/vagrant/go/src/github.com/loadimpact/k6", type: "rsync"

loadgen.vm.provision :salt do |salt|
salt.bootstrap_options = "-F -c /tmp -i loadgen"
salt.grains_config = "external/vagrant/loadgen_grains.yml"
salt.minion_config = "external/vagrant/salt_minion.yml"
salt.minion_key = "external/vagrant/loadgen.pem"
salt.minion_pub = "external/vagrant/loadgen.pub"
salt.install_master = true
salt.master_config = "external/vagrant/salt_master.yml"
salt.seed_master = {
loadgen: "external/vagrant/loadgen.pub",
influx: "external/vagrant/influx.pub",
web: "external/vagrant/web.pub",
}
end
end
loadgen.vm.provision :salt do |salt|
salt.bootstrap_options = "-F -c /tmp -i loadgen"
salt.grains_config = "external/vagrant/loadgen_grains.yml"
salt.minion_config = "external/vagrant/salt_minion.yml"
salt.minion_key = "external/vagrant/loadgen.pem"
salt.minion_pub = "external/vagrant/loadgen.pub"
salt.install_master = true
salt.master_config = "external/vagrant/salt_master.yml"
salt.seed_master = {
loadgen: "external/vagrant/loadgen.pub",
influx: "external/vagrant/influx.pub",
web: "external/vagrant/web.pub",
}
end
end

config.vm.define "influx" do |influx|
influx.vm.provider "virtualbox" do |vb|
vb.memory = 2048
vb.cpus = 2
end
influx.vm.hostname = "influx"
influx.vm.network "private_network", ip: "172.16.0.3"
config.vm.define "influx" do |influx|
influx.vm.provider "virtualbox" do |vb|
vb.memory = 2048
vb.cpus = 2
end
influx.vm.hostname = "influx"
influx.vm.network "private_network", ip: "172.16.0.3"

influx.vm.provision :salt do |salt|
salt.bootstrap_options = "-F -c /tmp -i influx"
salt.grains_config = "external/vagrant/influx_grains.yml"
salt.minion_config = "external/vagrant/salt_minion.yml"
salt.minion_key = "external/vagrant/influx.pem"
salt.minion_pub = "external/vagrant/influx.pub"
end
end
influx.vm.provision :salt do |salt|
salt.bootstrap_options = "-F -c /tmp -i influx"
salt.grains_config = "external/vagrant/influx_grains.yml"
salt.minion_config = "external/vagrant/salt_minion.yml"
salt.minion_key = "external/vagrant/influx.pem"
salt.minion_pub = "external/vagrant/influx.pub"
end
end

config.vm.define "web" do |web|
web.vm.provider "virtualbox" do |vb|
vb.memory = 2048
vb.cpus = 2
end
web.vm.hostname = "web"
web.vm.network "private_network", ip: "172.16.0.4"
config.vm.define "web" do |web|
web.vm.provider "virtualbox" do |vb|
vb.memory = 2048
vb.cpus = 2
end
web.vm.hostname = "web"
web.vm.network "private_network", ip: "172.16.0.4"

web.vm.provision :salt do |salt|
salt.bootstrap_options = "-F -c /tmp -i web"
salt.grains_config = "external/vagrant/web_grains.yml"
salt.minion_config = "external/vagrant/salt_minion.yml"
salt.minion_key = "external/vagrant/web.pem"
salt.minion_pub = "external/vagrant/web.pub"
end
end
web.vm.provision :salt do |salt|
salt.bootstrap_options = "-F -c /tmp -i web"
salt.grains_config = "external/vagrant/web_grains.yml"
salt.minion_config = "external/vagrant/salt_minion.yml"
salt.minion_key = "external/vagrant/web.pem"
salt.minion_pub = "external/vagrant/web.pub"
end
end
end
2 changes: 1 addition & 1 deletion api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/GeertJohan/go.rice"
log "github.com/Sirupsen/logrus"
"github.com/gin-gonic/gin"
"github.com/loadimpact/speedboat/lib"
"github.com/loadimpact/k6/lib"
"github.com/manyminds/api2go"
"github.com/manyminds/api2go/jsonapi"
"gopkg.in/tylerb/graceful.v1"
Expand Down
4 changes: 2 additions & 2 deletions api/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"bytes"
"encoding/json"
"errors"
"github.com/loadimpact/speedboat/lib"
"github.com/loadimpact/speedboat/stats"
"github.com/loadimpact/k6/lib"
"github.com/loadimpact/k6/stats"
"github.com/manyminds/api2go"
"github.com/manyminds/api2go/jsonapi"
"io/ioutil"
Expand Down
42 changes: 21 additions & 21 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
machine:
services:
- docker
services:
- docker

checkout:
post:
- git submodule update --init
post:
- git submodule update --init

dependencies:
override:
- docker info
- docker build -t loadimpact/speedboat .
- echo "{\"https://index.docker.io/v1/\":{\"auth\":\"$DOCKER_AUTH\",\"email\":\"$DOCKER_EMAIL\"}}" >~/.dockercfg
override:
- docker info
- docker build -t loadimpact/k6 .
- echo "{\"https://index.docker.io/v1/\":{\"auth\":\"$DOCKER_AUTH\",\"email\":\"$DOCKER_EMAIL\"}}" >~/.dockercfg

test:
override:
- docker run --entrypoint /bin/bash loadimpact/speedboat -c 'cd $GOPATH/src/github.com/loadimpact/speedboat && go get -t ./... && go test ./...'
override:
- docker run --entrypoint /bin/bash loadimpact/k6 -c 'cd $GOPATH/src/github.com/loadimpact/k6 && go get -t ./... && go test ./...'

deployment:
release:
branch: master
owner: loadimpact
commands:
- docker push loadimpact/speedboat
release:
branch: master
owner: loadimpact
commands:
- docker push loadimpact/k6

develop:
branch: develop
owner: loadimpact
commands:
- docker tag loadimpact/speedboat loadimpact/speedboat:develop
- docker push loadimpact/speedboat:develop
develop:
branch: develop
owner: loadimpact
commands:
- docker tag loadimpact/k6 loadimpact/k6:develop
- docker push loadimpact/k6:develop
6 changes: 3 additions & 3 deletions ctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package main
import (
log "github.com/Sirupsen/logrus"
"github.com/ghodss/yaml"
"github.com/loadimpact/speedboat/api"
"github.com/loadimpact/speedboat/lib"
"github.com/loadimpact/speedboat/stats"
"github.com/loadimpact/k6/api"
"github.com/loadimpact/k6/lib"
"github.com/loadimpact/k6/stats"
"gopkg.in/guregu/null.v3"
"gopkg.in/urfave/cli.v1"
"os"
Expand Down
4 changes: 2 additions & 2 deletions external/aws/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ To set up a lab environment on Amazon AWS (on the `eu-west-1` region):

3. **Prepare an access key**

Generate a key called `speedboat-test` on the IAM page for your user, and save it as `speedboat-test.pem` in this directory.
Generate a key called `k6-test` on the IAM page for your user, and save it as `k6-test.pem` in this directory.

If you already have a different key you'd like to use, you can add the following to `terraform.tfvars` and save it as `YOUR_KEY_NAME.pem` instead:

Expand All @@ -38,7 +38,7 @@ To set up a lab environment on Amazon AWS (on the `eu-west-1` region):
5. **Do the other thing**

```
ssh -i speedboat-test.pem ubuntu@LOADGEN_IP
ssh -i k6-test.pem ubuntu@LOADGEN_IP
# on loadgen
sudo salt '*' state.highstate
Expand Down
8 changes: 4 additions & 4 deletions external/aws/salt/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ hash_type: sha256
auto_accept: True
state_verbose: False
file_roots:
base:
- /home/ubuntu/go/src/github.com/loadimpact/speedboat/external/salt
base:
- /home/ubuntu/go/src/github.com/loadimpact/k6/external/salt
pillar_roots:
base:
- /home/ubuntu/go/src/github.com/loadimpact/speedboat/external/pillar
base:
- /home/ubuntu/go/src/github.com/loadimpact/k6/external/pillar
Loading

0 comments on commit 5af667a

Please sign in to comment.