项目作者: martel-innovate

项目描述 :
A Docker Image to perform load test on Orion Context Broker
高级语言: Shell
项目地址: git://github.com/martel-innovate/ngsi-load-tester.git
创建时间: 2017-02-20T18:16:51Z
项目社区:https://github.com/martel-innovate/ngsi-load-tester

开源协议:Apache License 2.0

下载


NGSI Load Tester

This repository provides a simple Docker image that execute load test on a
Orion Context Broker instance
(without any authentication mechanism enabled).

The load tester is based on artillery.io, an easy-to-use
load testing toolkit. Should you need to customize it, is should not be too
difficult ;)

Image Build

To create the image from the repository, simply execute:

  1. docker build -t martel/ngsi-load-tester .

Run the Container

To run the container, simply execute:

  1. docker run -e ART_TARGET=orion_context_broker:port martel/ngsi-load-tester

Where orion_context_broker is the ip of the Context Broker instance you want
to test and port is the active port of the Context Broker.

If you want to test an Orion Context Running in a container, execute:

  1. docker run --link container_name:orion martel/ngsi-load-tester

Where container_name is the name of the container where your context broker
runs.

Configurable variables

Variable Name Description Default Value
ART_TARGET The url of the context broker instance to be tested http://localhost:1026
ART_ARRIVALRATE specify the arrival rate of virtual users for a duration of time 5
ART_DURATION specify the duration of each test 10
ART_RAMPTO specify the pick arrival rate 20
ART_DEBUG The debug settings for request and response. Set empty for not printing request and response. Set to http to print requests, and to http:response to print responses. http,http:response to print both. http,http:response

Example

  1. docker run --link ngsiloadtester_orion_1:orion \
  2. -e ART_DEBUG='' \
  3. -e ART_ARRIVALRATE=10 \
  4. -e ART_DURATION=50 martel/ngsi-load-tester

Example adopted

The NGSI Load Tester use the data model of the
NGSI API Walkthrough.
Entities created are of the type Room and contain temperature and pressure
attributes.

  1. "id": "Room1",
  2. "type": "Room",
  3. "temperature": {
  4. "value": 23,
  5. "type": "Float"
  6. },
  7. "pressure": {
  8. "value": 720,
  9. "type": "Integer"
  10. }
  11. }

Test the container locally

You can run a simple test by launching the example Orion Context Broker compose
file, and linking to it.

From the main directory run:

  1. docker-compose up -d
  2. docker run --link ngsiloadtester_orion_1:orion martel/ngsi-load-tester

HOW TO CONTRIBUTE

Make pull requests :)

TODO

  1. Better divide test in write / read / delete & read and write.
  2. Provide instructions on how to export results.
  3. Graph generation would be nice.
  4. Explore
    statsd integration.