Skip to content

Commit f74e3f4

Browse files
committed
Updates to Action Cable tests
1 parent f3c65b6 commit f74e3f4

File tree

4 files changed

+18
-14
lines changed

4 files changed

+18
-14
lines changed

rails/Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,5 @@ gem 'pg', '0.18.1'
2727
gem 'benchmark-ips', '~> 2.2.0'
2828
gem 'em-hiredis', '~> 0.3.0'
2929
gem 'redis', '~> 3.0'
30+
gem 'faye-websocket'
31+
gem 'puma'

rails/benchmarks/actioncable_postgres.rb

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@
1313
Benchmark.rails("actioncable_postgres", time: 10) do
1414
pg_config = { adapter: 'postgresql', url: PG_DB_URL }.with_indifferent_access
1515
with_puma_server(ActionCable.server, 4001, pg_config) do |port|
16-
sleep
17-
end
18-
19-
500.times do
20-
PG_FAYE.send(SUB)
21-
PG_FAYE.send(MSG)
16+
500.times do
17+
PG_FAYE.send(SUB)
18+
PG_FAYE.send(MSG)
19+
end
2220
end
2321
end

rails/benchmarks/actioncable_redis.rb

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@
1111
Benchmark.rails("actioncable_redis", time: 10) do
1212
redis_config = { adapter: 'redis', url: REDIS_DB_URL }.with_indifferent_access
1313
with_puma_server(ActionCable.server, 4002, redis_config) do |port|
14-
sleep
15-
end
16-
17-
500.times do
18-
REDIS_FAYE.send(SUB)
19-
REDIS_FAYE.send(MSG)
14+
500.times do
15+
REDIS_FAYE.send(SUB)
16+
REDIS_FAYE.send(MSG)
17+
end
2018
end
2119
end

rails/benchmarks/support/actioncable_helpers.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
require 'actioncable'
1+
require 'action_cable'
22
require 'rack/mock'
33
require 'faye/websocket'
44
require 'active_support/core_ext/hash/indifferent_access'
55
require 'pathname'
6-
require 'json'
6+
require 'puma'
7+
8+
module Rails
9+
def self.root
10+
Pathname.pwd
11+
end
12+
end
713

814
::Object.const_set(:ApplicationCable, Module.new)
915

0 commit comments

Comments
 (0)