Giter VIP home page Giter VIP logo

gerbo's Introduction

Gerbo

Getting started

Clone the repository in folder do you prefer

cd /var/www
git clone https://github.com/luk4z7/gerbo.git

Execute the file init.sh for up the docker containers

https://github.com/luk4z7/gerbo for the canonical source repository
Lucas Alves 2017 (c) Gerbo - Rodent and data extractor


  ____           _
 / ___| ___ _ __| |__   ___
| |  _ / _ \ '__| '_ \ / _ \
| |_| |  __/ |  | |_) | (_) |
 \____|\___|_|  |_.__/ \___/

Gerbo

DOCKER
Generate new containers  [ 1 ]
Delete all containers    [ 2 ]
Start new build          [ 3 ]
Preview the logs         [ 4 ]
Install dependencies     [ 5 ]
Access the shell (gerbo) [ 6 ]
Access the shell (mongo) [ 7 ]

First step

Start new build          [ 3 ]

Second step

Generate new containers  [ 1 ]

Preview the all logs of containers

Preview the logs         [ 4 ]

Or access the single container

docker logs gerbo -f
docker logs mongo -f

The golang container generates records in the database that are checked from time to time to be synchronized.

➜  gerbo (develop) ✗ docker logs gerbo -f
[00] Starting service
[00] [build.sh:building binary]
[00] [build.sh:launching binary]
[00] INFO 2017/07/12 22:04:57.094186 main.go:15: Running!
Generated registers on database sqlite by robots
Generated registers on database sqlite by robots
Generated registers on database sqlite by robots
INFO 2017/07/12 22:08:51.055626 operation.go:52: Synchronizing...
INFO 2017/07/13 02:16:05.809537 operation.go:80: movie ->  109020
INFO 2017/07/13 02:16:05.820248 operation.go:80: movie ->  7087863
INFO 2017/07/13 02:16:05.861599 operation.go:80: movie ->  7087858
INFO 2017/07/13 02:16:05.871442 operation.go:80: movie ->  7087857
Generated registers on database sqlite by robots

API REST

Routers

In this examples I using jq for pretty the result, for more information view in : jq

Quais os filmes com melhor avaliação média? this route use pagination, with 20 records per page, only change the number of page at the end the route

curl -H "Content-Type: application/json" -X GET http://127.0.0.1:6060/v1/movies/best/page/6 | jq

Quais os gêneros com melhor avaliação média?

curl -H "Content-Type: application/json" -X GET http://127.0.0.1:6060/v1/movies/genre/best | jq

Quais os gêneros com mais filmes?

curl -H "Content-Type: application/json" -X GET http://127.0.0.1:6060/v1/movies/genre/winner | jq

Qual a avaliação média por gênero?

curl -H "Content-Type: application/json" -X GET http://127.0.0.1:6060/v1/movies/rating/genre | jq

Qual a avaliação média por ano?

curl -H "Content-Type: application/json" -X GET http://127.0.0.1:6060/v1/movies/rating/year | jq

Qual a distribuição do número de filmes produzidos por ano?

curl -H "Content-Type: application/json" -X GET http://127.0.0.1:6060/v1/movies/distribution/year | jq

Qual a distribuição do número de filmes produzidos por década?

curl -H "Content-Type: application/json" -X GET http://127.0.0.1:6060/v1/movies/distribution/decade | jq

Test HTTP benchmarking

see more in https://github.com/wg/wrk

wrk -t12 -c200 -d30s http://127.0.0.1:6060/v1/movies/best/page/10

Import database

If you want to import the mongo database, run this sequence of commands

docker exec -it mongo bash

root@c5bee63f533a:/# cd /var/www/

mongoimport --verbose --db gerbo --collection movies < movies-12-07-2017.json

asciicast

asciicast

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.