1
0
mirror of https://github.com/mainflux/mainflux.git synced 2025-04-26 13:48:53 +08:00
Darko Draskovic 2b393ad50f MF-237 - Add support for storing messages in MongoDB (#307)
* Add mongodb-writer

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add official mongodb driver

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Move Connect to main.go

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove bson.NewDoc and write msg directly in db

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add MongoDB writer tests

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update README.md

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add mongodb services compose to addons dir

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update docs

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update docs and tests

Refactor code.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Expose MetricsMiddleware to align writers with other services

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add logging middleware

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update load tests version

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2018-06-01 15:50:23 +02:00
..
2018-05-17 14:21:08 +02:00

Load Test

This project contains platform's load tests.

Prerequisites

To run the tests you must have OpenJDK8 and SBT installed on your machine.

Configuration

Tests are configured to use variables from JAVA_OPTS presented in the following table. Note that any unset variables will be replaced with their default values.

Variable Description Default
users Users service URL http://localhost:8180
things Things service URL http://localhost:8182
http HTTP adapter service URL http://localhost:8185
ws WebSocket adapter service URL localhost:8186
requests Number of requests to be sent per second 100

Usage

This project contains three simulations:

  • CreateAndRetrieveThings
  • PublishHttpMessages
  • PublishWsMessages

To run all tests you will have to run following commands:

cd <path_to_mainflux_project>/load-test
sbt gatling:test

Things creation and retrieval

CreateAndRetrieveThings contains load tests for creating and retrieving things. Execute the following command to run the suite:

sbt "gatling:testOnly com.mainflux.loadtest.CreateAndRetrieveThings"

Message publishing over HTTP adapter

PublishHttpMessages contains load tests for publishing messages over HTTP. Execute the following command to run the suite:

sbt "gatling:testOnly com.mainflux.loadtest.PublishHttpMessages"

Message publishing over WebSocket adapter

PublishWsMessages contains load tests for publishing messages over WebSocket. Execute the following command to run the suite:

sbt "gatling:testOnly com.mainflux.loadtest.PublishWsMessages"