Skip to content

Microservice to consume and compute company statistics using hand-made MapReduce

Notifications You must be signed in to change notification settings

danylokravchenko/CompanyStatistics

Repository files navigation

Microservice to store and manage statistics for companies

How to run

Example of config.yaml file

authToken: "5672139asdaw"
port: ":8080"
timeLayout: "2006-01-02 15:04:05"
dateLayout: "2006-01-02"
mysqlURL: "cobrareviews:password@/cobrareviews"
mode: "dev" # or 'prod'

Add config.yaml to config directory. If you are using docker on local instance, add to /etc/mysql/my.cnf next lines to allow listening to all ports:

[mysqld]
bind-address = 0.0.0.0

and restart mysql sudo service mysql restart
(If you need some help with MySQL connection URL, you could read https://github.com/go-sql-driver/mysql).
And finally, execute go run server.go from directory, where server.go is located

How to run using Make

  • make run - to start server
  • make docker-up - to run docker
  • make docker-down - to shut down docker
  • make test-stats - to run tests for stats
  • make test-company - to run tests for company

How to run docker

docker-compose up --build

How to run tests

They are testing Rest API, so you need to have a working server.
Firstly, setup the server by running go run server.go
Then in new terminal run cd tests/(stats or company) and go test .

How to run benchmark

cd tests/stats/benchmark && go test -bench . -count 10

About

Microservice to consume and compute company statistics using hand-made MapReduce

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published