Sign inSign up

drefixs/test-request-keeper

By drefixs

•Updated almost 9 years ago

Test request container with built symfony app

Image
0

2.1K

drefixs/test-request-keeper repository overview

Build Status Scrutinizer Code Quality Code Coverage Build Status SensioLabsInsight

⁠Test Request-Keeper

API, that provides ability to save request info to it and get list of received requests using filters.

⁠Single line install with docker

Run this app with docker is simply amazing!

Tested with docker version >=17.06.0

Make sure that 8080 port is free before start:

Select you projects directory and enjoy this single line install for docker (Mac⁠, linux⁠):

git clone [email protected]:drefixs/test-request-keeper.git && cd test-request-keeper/server && docker stack deploy -c docker-compose.prod.yml request-keeper && sleep 10 && open http://localhost:8080/

⁠Requirements

  • MySQL >= 5.7.10
  • php 5.6 | 7.1
  • extra php extension:
    • ext-pdo_mysql

⁠Manual install

First pls set up all requirements then run the next command

 composer install --prefer-dist
 
 #if app configured user doesn't have permission to crete database   
 bin/console doctrine:database:create
 
 # create tables and schema
 bin/console doctrine:schema:create

⁠Api interfaces

⁠High performance features

⁠ReactPHP integration for the fast request storing

The app contain raw integration of the ReactPHP, it also has ready to run docker images with ReactPHP. It provide high speed 14-20 milliseconds per request.

# run ReactPHP synfony integrated server
bin/react_server

# now you can test speed of this solution with curl (first request can be slow if cache not warmed)
curl -d "some data to post." -H "Content-Type: text/plain" -X POST "http://localhost:8000/request/store/my_test_request"

10-20 milliseconds for storing single request Single request storing time in browser

0.8 seconds for storing 100 requests ! (in demo more time spent for prepare lorem ipsum for requests) Single request storing time with curl

# you can test it by yourself with the next command
# $brew install lorem 
# command tested in macOS, in Linux pls use usleep and set up lorem 
COUNT=100; mkdir -f /tmp/test-lorem-list; rm /tmp/test-lorem-list/* ; for NUM in `seq ${COUNT}`; do  lorem --words ${WORDS:-100} --randomize > /tmp/test-lorem-list/${NUM} &  done ;wait ;\
time { for FILE in /tmp/test-lorem-list/* ; do curl -d ${FILE} -H "Content-Type: text/plain" -X POST "http://localhost:8080/request/store/${FILE}" & sleep 0.002 ; done ; wait ; }
⁠full-text right or left wildcard search for mySQL

Also this solution provide full-text high performance search that equal (LIKE '%sub' OR LIKE 'sub%') .

It gets possible by using reversed generated stored row⁠ that appeared with mysql version 5.7.10

Tag summary

Content type

Image

Digest

Size

97.4 MB

Last updated

almost 9 years ago

docker pull drefixs/test-request-keeper