Skip to content
Open

Task4 #133

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/dubnium
lts/erbium
3 changes: 3 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
--color
--require spec_helper

--format progress
--format ParallelTests::RSpec::RuntimeLogger --out tmp/parallel_runtime_rspec.log
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cache:
- node_modules
- $HOME/.nvm
rvm:
- 2.6.1
- 2.6.3
addons:
postgresql: '9.6'
chrome: stable
Expand Down
29 changes: 24 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ end
gem "actionpack-action_caching", "~> 1.2"
gem "active_record_union", "~> 1.3"
gem "acts-as-taggable-on", "~> 5.0"
gem "acts_as_follower", github: "forem/acts_as_follower", branch: "master"
gem 'acts_as_follower', github: 'tcocca/acts_as_follower', branch: 'master'
gem "addressable", "~> 2.5", ">= 2.5.2"
gem "administrate", "~> 0.11"
gem "ahoy_email", "~> 0.5"
Expand Down Expand Up @@ -50,7 +50,6 @@ gem "front_matter_parser", "~> 0.2"
gem "gemoji", "~> 3.0.0"
gem "gibbon", "~> 2.2"
gem "google-api-client", "~> 0.27"
gem "honeycomb-rails"
gem "html_truncator", "~> 0.4"
gem "httparty", "~> 0.16"
gem "inline_svg", "~> 1.3"
Expand Down Expand Up @@ -89,7 +88,6 @@ gem "sdoc", "~> 1.0", group: :doc
gem "serviceworker-rails", "~> 0.5"
gem "share_meow_client", "~> 0.1"
gem "sitemap_generator", "~> 6.0"
gem "skylight", "~> 3.1"
gem "slack-notifier", "~> 2.3"
gem "sprockets", "~> 3.7"
gem "staccato", "~> 0.5"
Expand All @@ -103,6 +101,28 @@ gem "validate_url", "~> 1.0"
gem "webpacker", "~> 3.5"
gem "webpush", "~> 0.3"

# gem "skylight", "~> 3.1"
# gem 'ddtrace', require: 'ddtrace/auto_instrument'
gem "newrelic_rpm"
gem "scout_apm"

gem "influxer", "~> 1.2"

group :development, :local_production do
gem "meta_request"
gem "prometheus_exporter"
gem "rack-mini-profiler", require: false
end

group :development, :local_production, :test do
gem "memory_profiler", "~> 0.9"
gem "stackprof", "~> 0.2", require: false, platforms: :ruby
end

group :production, :development do
gem "honeycomb-rails"
end

group :development do
gem "better_errors", "~> 2.5"
gem "binding_of_caller", "~> 0.8"
Expand All @@ -123,7 +143,6 @@ group :development, :test do
gem "erb_lint", "~> 0.0", require: false
gem "faker", git: "https://github.com/stympy/faker.git", branch: "master"
gem "fix-db-schema-conflicts", github: "jakeonrails/fix-db-schema-conflicts", branch: "master"
gem "memory_profiler", "~> 0.9"
gem "parallel_tests", "~> 2.27"
gem "pry-byebug", "~> 3.7"
gem "rspec-rails", "~> 3.8"
Expand All @@ -132,6 +151,7 @@ group :development, :test do
gem "rubocop-rspec", "~> 1.31"
gem "spring", "~> 2.0"
gem "spring-commands-rspec", "~> 1.0"
gem "tty-command"
gem "vcr", "~> 4.0"
end

Expand All @@ -149,7 +169,6 @@ group :test do
gem "shoulda-matchers", "4.0.0.rc1", require: false
gem "simplecov", "~> 0.16", require: false
gem "sinatra", "~> 2.0"
gem "stackprof", "~> 0.2", require: false, platforms: :ruby
gem "stripe-ruby-mock", "~> 2.5", require: "stripe_mock"
gem "test-prof", "~> 0.7"
gem "timecop", "~> 0.9"
Expand Down
74 changes: 51 additions & 23 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
GIT
remote: https://github.com/forem/acts_as_follower.git
revision: 06393d3693a1a3d4b390aec4976c8b8f3a81cf01
branch: master
specs:
acts_as_follower (0.2.1)
activerecord (>= 4.0)

GIT
remote: https://github.com/jakeonrails/fix-db-schema-conflicts.git
revision: 18f653251f49a50702dce076f0ecfaab5e928417
revision: 1e94f518503f1d1addd6ed052454efcbec0b3c6a
branch: master
specs:
fix-db-schema-conflicts (3.0.3)
fix-db-schema-conflicts (3.1.0)
rubocop (>= 0.38.0)

GIT
Expand All @@ -22,6 +14,14 @@ GIT
faker (1.9.1)
i18n (>= 0.7)

GIT
remote: https://github.com/tcocca/acts_as_follower.git
revision: c5ac7b9601c4af01eb4d9112330b27be4d694ecc
branch: master
specs:
acts_as_follower (0.2.1)
activerecord (>= 4.0)

GEM
remote: https://rubygems.org/
remote: https://rails-assets.org/
Expand Down Expand Up @@ -112,13 +112,15 @@ GEM
json (~> 1.8)
ancestry (3.0.5)
activerecord (>= 3.2.0)
anyway_config (2.4.0)
ruby-next-core (>= 0.14.0)
approvals (0.0.24)
nokogiri (~> 1.6)
thor (~> 0.18)
archive-zip (0.11.0)
io-like (~> 0.3.0)
arel (8.0.0)
ast (2.4.0)
ast (2.4.2)
autoprefixer-rails (9.4.3)
execjs
aws-eventstream (1.0.1)
Expand Down Expand Up @@ -212,7 +214,7 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.1.5)
concurrent-ruby (1.2.2)
connection_pool (2.2.2)
counter_culture (2.1.2)
activerecord (>= 3.0.0)
Expand Down Expand Up @@ -536,10 +538,15 @@ GEM
mime-types (~> 3.0)
multi_xml (>= 0.5.2)
httpclient (2.8.3)
i18n (1.6.0)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
inflecto (0.0.2)
influxdb (0.8.1)
influxer (1.4.0)
activemodel (>= 3.2.0)
anyway_config (>= 2.0)
influxdb (~> 0.8)
inline_svg (1.3.1)
activesupport (>= 3.0)
nokogiri (>= 1.6)
Expand Down Expand Up @@ -592,13 +599,16 @@ GEM
memoizable (0.4.2)
thread_safe (~> 0.3, >= 0.3.1)
memory_profiler (0.9.12)
meta_request (0.7.4)
rack-contrib (>= 1.1, < 3)
railties (>= 3.0.0, < 7.1)
method_source (0.9.2)
mime-types (3.2.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2018.0812)
mini_mime (1.0.1)
mini_portile2 (2.4.0)
minitest (5.11.3)
minitest (5.18.0)
momentjs-rails (2.20.1)
railties (>= 3.1)
msgpack (1.2.4)
Expand All @@ -612,6 +622,7 @@ GEM
net-http-persistent (3.0.0)
connection_pool (~> 2.2)
netrc (0.11.0)
newrelic_rpm (9.1.0)
nio4r (2.3.1)
nokogiri (1.10.1)
mini_portile2 (~> 2.4.0)
Expand Down Expand Up @@ -647,10 +658,14 @@ GEM
parallel (1.13.0)
parallel_tests (2.27.1)
parallel
parser (2.6.0.0)
ast (~> 2.4.0)
parser (3.2.2.0)
ast (~> 2.4.1)
pastel (0.8.0)
tty-color (~> 0.5)
pg (1.1.4)
powerpack (0.1.2)
prometheus_exporter (2.0.8)
webrick
pry (0.12.2)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
Expand All @@ -675,8 +690,12 @@ GEM
pusher-signature (0.1.8)
raabro (1.1.6)
rack (2.0.6)
rack-contrib (2.3.0)
rack (~> 2.0)
rack-host-redirect (1.3.0)
rack
rack-mini-profiler (3.0.0)
rack (>= 1.2.0)
rack-protection (2.0.4)
rack
rack-proxy (0.6.5)
Expand Down Expand Up @@ -781,6 +800,7 @@ GEM
unicode-display_width (~> 1.4.0)
rubocop-rspec (1.31.0)
rubocop (>= 0.60.0)
ruby-next-core (0.15.3)
ruby-prof (0.17.0)
ruby-progressbar (1.10.0)
ruby_dep (1.5.0)
Expand Down Expand Up @@ -813,6 +833,8 @@ GEM
addressable (>= 2.3.5, < 2.6)
faraday (~> 0.8, < 1.0)
sax-machine (1.3.2)
scout_apm (5.3.3)
parser
sdoc (1.0.0)
rdoc (>= 5.0)
selectize-rails (0.12.6)
Expand Down Expand Up @@ -843,10 +865,6 @@ GEM
tilt (~> 2.0)
sitemap_generator (6.0.2)
builder (~> 3.0)
skylight (3.1.4)
skylight-core (= 3.1.4)
skylight-core (3.1.4)
activesupport (>= 4.2.0)
slack-notifier (2.3.2)
smart_properties (1.13.1)
spring (2.0.2)
Expand All @@ -872,14 +890,17 @@ GEM
dante (>= 0.2.0)
multi_json (~> 1.0)
stripe (>= 2.0.3)
test-prof (0.7.3)
test-prof (0.12.2)
thor (0.20.3)
thread_safe (0.3.6)
tilt (2.0.9)
timber (2.6.2)
msgpack (~> 1.0)
timecop (0.9.1)
trollop (2.1.2)
tty-color (0.6.0)
tty-command (0.10.1)
pastel (~> 0.8)
twilio-ruby (5.21.0)
faraday (~> 0.9)
jwt (>= 1.5, <= 2.5)
Expand All @@ -895,7 +916,7 @@ GEM
multipart-post (~> 2.0)
naught (~> 1.0)
simple_oauth (~> 0.3.0)
tzinfo (1.2.5)
tzinfo (1.2.11)
thread_safe (~> 0.1)
uber (0.1.0)
uglifier (4.1.20)
Expand Down Expand Up @@ -932,6 +953,7 @@ GEM
webpush (0.3.2)
hkdf (~> 0.2)
jwt
webrick (1.8.1)
websocket-driver (0.6.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.3)
Expand Down Expand Up @@ -1004,6 +1026,7 @@ DEPENDENCIES
honeycomb-rails
html_truncator (~> 0.4)
httparty (~> 0.16)
influxer (~> 1.2)
inline_svg (~> 1.3)
jbuilder (~> 2.8)
jquery-rails (~> 4.3)
Expand All @@ -1012,14 +1035,17 @@ DEPENDENCIES
libhoney (~> 1.11)
liquid (~> 4.0)
memory_profiler (~> 0.9)
meta_request
nakayoshi_fork
newrelic_rpm
nokogiri (~> 1.10)
octokit (~> 4.13)
omniauth (~> 1.9)
omniauth-github (~> 1.3)
omniauth-twitter (~> 1.4)
parallel_tests (~> 2.27)
pg (~> 1.1)
prometheus_exporter
pry (~> 0.12)
pry-byebug (~> 3.7)
pry-rails (~> 0.3)
Expand All @@ -1029,6 +1055,7 @@ DEPENDENCIES
pusher (~> 1.3)
pusher-push-notifications (~> 1.0)
rack-host-redirect (~> 1.3)
rack-mini-profiler
rack-timeout (~> 0.5)
rails (~> 5.1.6)
rails-assets-airbrake-js-client (~> 1.5)!
Expand All @@ -1049,6 +1076,7 @@ DEPENDENCIES
s3_direct_upload (~> 0.1)
sail (~> 1.5)
sass-rails (~> 5.0)
scout_apm
sdoc (~> 1.0)
selenium-webdriver (~> 3.141)
serviceworker-rails (~> 0.5)
Expand All @@ -1057,7 +1085,6 @@ DEPENDENCIES
simplecov (~> 0.16)
sinatra (~> 2.0)
sitemap_generator (~> 6.0)
skylight (~> 3.1)
slack-notifier (~> 2.3)
spring (~> 2.0)
spring-commands-rspec (~> 1.0)
Expand All @@ -1070,6 +1097,7 @@ DEPENDENCIES
test-prof (~> 0.7)
timber (~> 2.6)
timecop (~> 0.9)
tty-command
twilio-ruby (~> 5.21)
twitter (~> 6.2)
uglifier (~> 4.1)
Expand Down
45 changes: 42 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,43 @@
.PHONY: run
.PHONY: test

run:
docker-compose build && docker-compose run --rm web rails db:setup
# run:
# docker-compose build && docker-compose run --rm web rails db:setup

siege:
siege -c 10 -t180s http://localhost:3000
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


siege-short:
siege -c 10 -t30s http://localhost:3000

setup:
bin/setup

dev:
bin/startup

clean:
bin/rails jobs:clear

lprod:
RAILS_ENV=local_production bin/startup

ab: siege-short
sleep 5
ab -n 100 http://127.0.0.1:3000/

test:
rake test:run

profile:
bundle exec rspec --profile

test-event:
EVENT_PROF='sql.active_record' bundle exec rspec
test-factory:
EVENT_PROF='factory.create' bundle exec rspec
test-pro:
FPROF='1' bundle exec rspec
test-doc:
FDOC='1' bundle exec rspec

test-all: test-event test-factory test-pro
Loading