It is composed of 3 services
Psums can be installed in two different ways
First is to pull all three services and put them in same directory (each service in its own directory and then all put in same parent directory). Then go to Aggregator directory and run
docker-compose upThis will build up all containers, and those are following:
- psums_aggregator
- psums_streams
- psums_api
- psums_mysql
- psums_memcached
docker container exec -it bash psums_aggregatorphp library/phinx/bin/phinx migrateSecond way is by using Psums composer, you can follow instalation instructions on that repository. It will install production version without access to code base
It pretty much uses itself :) Entire process is automated with crons. What aggregator dose is take input streams sent by psums_streams service, parses them and saves word stream to database. Thats the fist part of his code base, saving input streams. Second part is applying pre defined rules to that stream and saving results. And that is, simple right. Those results will then be used by psums_api service to be exposed i format of REST api response.Aggregator comes with 4 rules out of box. Those are:
- compare_vowels: This rule counts number of vowels in words and makes comparison between streams
- pook_beef: Funy as it sounds, this rule counts occurrences of pook in first stream and beef in second one, and compares them
- pattern: Uses provided patter to check occurrence of symbols in both streams, and compare
- match_making: For all words pairs in pattern, checks both steams and tries to first word in first stream and second word in second stream
tail -f cron.logResults of rules cycles will be saved to rules_results table
If you wish to run included unit test, it can be done by running following command from /var/www/html directory
php vendor/phpunit/phpunit/phpunit testsAnd that's all she wroth, for other services docs check their respected repositories, and as always have fun :)