Giter VIP home page Giter VIP logo

chat-api-server's Introduction

Chat API Server

build status standard-readme compliant

Chat backend server.

Sample front-end app: IzumiSy/chat-frontend

Deploy

Table of Contents

Setup

$ cp .env.sample .env
$ vi .env
...

Run

$ docker-compose build
$ docker-compose run app bundle exec rake seed
$ docker-compose up

Test

$ docker-compose run app bundle exec rspec

License

MIT © IzumiSy

chat-api-server's People

Contributors

dependabot[bot] avatar izumisy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jzxyouok

chat-api-server's Issues

Modelクラスをつくる

  • エラーハンドリングを行うコントロール用のスーパークラスを作る
  • 頻繁に使う処理をヘルパにする

Indexを張る

MongoDBのクエリにインデックスを張って速度改善をする

パフォーマンスチューニング

余計なDBのアクセスをなくしたり並行処理にしたりしてスピードを上げるなど

チューン前

Top 5 slowest examples (1.3 seconds, 44.9% of total time):
  POST /api/room/enter should have an user enter the room
    1.04 seconds ./spec/room_test_spec.rb:71
  POST /api/admin/auth should get auth_token
    0.13861 seconds ./spec/basic_test_spec.rb:22
  POST /api/room/:id/leave should have an user leave the room with 'all' for :id
    0.05835 seconds ./spec/room_test_spec.rb:105
  POST /api/room/new should NOT create a room by non-admin user
    0.03686 seconds ./spec/room_test_spec.rb:16
  POST /api/room/enter should get 500 error with invalid type
    0.03064 seconds ./spec/room_test_spec.rb:78

Top 5 slowest example groups:
  POST /api/room/enter
    0.35976 seconds average (1.08 seconds / 3 examples) ./spec/room_test_spec.rb:61
  POST /api/admin/auth
    0.03862 seconds average (0.15449 seconds / 4 examples) ./spec/basic_test_spec.rb:5
  POST /api/room/:id/leave
    0.03401 seconds average (0.10202 seconds / 3 examples) ./spec/room_test_spec.rb:84
  GET /api/room/:id/users
    0.01983 seconds average (0.01983 seconds / 1 example) ./spec/room_test_spec.rb:42
  POST /api/room/new
    0.01738 seconds average (0.06951 seconds / 4 examples) ./spec/room_test_spec.rb:3

Finished in 2.9 seconds (files took 2.53 seconds to load)

チューン後(#18, #17)

Top 5 slowest examples (0.27378 seconds, 14.5% of total time):
  POST /api/admin/auth should get auth_token
    0.12263 seconds ./spec/basic_test_spec.rb:22
  POST /api/room/enter should have an user enter the room
    0.04261 seconds ./spec/room_test_spec.rb:71
  POST /api/user/new should NOT create a new user
    0.04254 seconds ./spec/user_test_spec.rb:38
  POST /api/room/new should NOT create a room by non-admin user
    0.0375 seconds ./spec/room_test_spec.rb:16
  POST /api/room/:id/leave should have an user leave the room with 'all' for :id
    0.0285 seconds ./spec/room_test_spec.rb:100

Top 5 slowest example groups:
  POST /api/admin/auth
    0.03476 seconds average (0.13902 seconds / 4 examples) ./spec/basic_test_spec.rb:5
  GET /api/room/:id/users
    0.0286 seconds average (0.0286 seconds / 1 example) ./spec/room_test_spec.rb:42
  POST /api/room/:id/leave
    0.0251 seconds average (0.05019 seconds / 2 examples) ./spec/room_test_spec.rb:84
  POST /api/user/new
    0.02278 seconds average (0.06834 seconds / 3 examples) ./spec/user_test_spec.rb:22
  POST /api/room/enter
    0.02128 seconds average (0.06385 seconds / 3 examples) ./spec/room_test_spec.rb:61

Finished in 1.89 seconds (files took 2.58 seconds to load)

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.