- Overview
- Getting started
- How To...
- User Guide
- Migration
-
Reference
-
Steps
- addItem
- addToInt
- addToSharedCounter
- awaitAllResponses
- awaitDelay
- awaitInt
- awaitVar
- breakIfFinished
- breakSequence
- clearHttpCache
- conditional
- fail
- foreach
- getIndex
- getItem
- getSharedCounter
- getSize
- hotrodRequest
- httpRequest
- json
- log
- loop
- markRequestInvalid
- newSequence
- noop
- publishAgentData
- publishGlobalCounters
- pullSharedMap
- pushSharedMap
- randomCsvRow
- randomFile
- randomInt
- randomItem
- randomUUID
- readAgentData
- removeItem
- restartSequence
- scheduleDelay
- set
- setInt
- setItem
- setSharedCounter
- stop
- stopwatch
- stringToInt
- template
- thinkTime
- timestamp
- unset
-
Processors
- addItem
- addToInt
- addToSharedCounter
- array
- clearHttpCache
- closeConnection
- collection
- conditional
- count
- fail
- getIndex
- getItem
- getSharedCounter
- getSize
- gzipInflator
- json
- log
- logInvalid
- markRequestInvalid
- newSequence
- parseHtml
- publishAgentData
- publishGlobalCounters
- queue
- readAgentData
- removeItem
- restartSequence
- set
- setInt
- setItem
- setSharedCounter
- store
- storeInt
- stringToInt
- unset
- Actions
-
Steps
- Custom extensions
- Controller API
- Architecture
- Release notes
Starting the controller via Ansible
You can fetch release, distribute and start the cluster using Ansible Galaxy scripts; setup, test, shutdown
First, get the scripts:
ansible-galaxy install hyperfoil.hyperfoil_setup,0.23.0
ansible-galaxy install hyperfoil.hyperfoil_shutdown,0.23.0
ansible-galaxy install hyperfoil.hyperfoil_test,0.23.0
Now, edit your hosts
file, it could look like this:
[hyperfoil-controller]
controller ansible_host=localhost
[hyperfoil-agent]
agent-1 ansible_host=localhost
(You can add more agents by duplicating the last line with agent-2
etc.)
Prepare your playbook; here is a short example that starts the controller, uploads and starts simple benchmark (the templating engine replaces the agents in benchmark script based on Ansible hosts) and waits for its completion. When it confirms number of requests executed it stops the controller.
- hosts: [ hyperfoil-agent, hyperfoil-controller ]
tasks: [] # This will only gather facts about all nodes
- hosts: hyperfoil-controller
roles:
- hyperfoil.hyperfoil_setup
- hosts: 127.0.0.1
connection: local
roles:
- hyperfoil.hyperfoil_test
vars:
test_name: example
# Note that due to the way Ansible lookups work this will work only if hyperfoil-controller == localhost
- hosts: 127.0.0.1
connection: local
tasks:
- name: Find number of requests
set_fact:
test_requests: "{{ lookup('csvfile', 'example file=/tmp/hyperfoil/workspace/run/' + test_runid + '/stats/total.csv col=2 delimiter=,')}}"
- name: Print number of requests
debug:
msg: "Executed {{ test_requests }} requests."
- hosts:
- hyperfoil-controller
roles:
- hyperfoil.hyperfoil_shutdown
Finally, run the playbook:
ansible-playbook -i hosts example.yml