david 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/benchmarks/data/jruby-1.7.19-rack +84 -0
  4. data/benchmarks/data/jruby-1.7.19-rack.csv +29 -0
  5. data/benchmarks/data/jruby-1.7.19-rails +84 -0
  6. data/benchmarks/data/jruby-1.7.19-rails.csv +29 -0
  7. data/benchmarks/data/jruby-9.0.0.0-pre1-rack +84 -0
  8. data/benchmarks/data/jruby-9.0.0.0-pre1-rack.csv +29 -0
  9. data/benchmarks/data/jruby-9.0.0.0-pre1-rails +84 -0
  10. data/benchmarks/data/jruby-9.0.0.0-pre1-rails.csv +29 -0
  11. data/benchmarks/data/mri-2.2.0p0-rack +84 -0
  12. data/benchmarks/data/mri-2.2.0p0-rack.csv +29 -0
  13. data/benchmarks/data/mri-2.2.0p0-rails +84 -0
  14. data/benchmarks/data/mri-2.2.0p0-rails.csv +29 -0
  15. data/benchmarks/data/mri-2.3.0-dev-rack +84 -0
  16. data/benchmarks/data/mri-2.3.0-dev-rack.csv +29 -0
  17. data/benchmarks/data/mri-2.3.0-dev-rails +84 -0
  18. data/benchmarks/data/mri-2.3.0-dev-rails.csv +29 -0
  19. data/benchmarks/interop.sh +2 -0
  20. data/benchmarks/max.rb +3 -0
  21. data/benchmarks/plot.frameworks.r +30 -0
  22. data/benchmarks/plot.loss.r +35 -0
  23. data/benchmarks/plot.vms.r +37 -0
  24. data/benchmarks/rackup/Gemfile.lock +7 -1
  25. data/benchmarks/rackup/interop.ru +17 -0
  26. data/experiments/concurrency/stub.rb +5 -5
  27. data/lib/david/etsi.rb +5 -0
  28. data/lib/david/etsi/mandatory.rb +4 -0
  29. data/lib/david/{interop/mandatory_etsi → etsi/mandatory}/grape.rb +1 -1
  30. data/lib/david/{interop/mandatory_etsi → etsi/mandatory}/hobbit.rb +1 -1
  31. data/lib/david/{interop/mandatory_etsi → etsi/mandatory}/nyny.rb +1 -1
  32. data/lib/david/{interop/mandatory_etsi → etsi/mandatory}/rack.rb +3 -3
  33. data/lib/david/{interop/mandatory_etsi → etsi/mandatory}/sinatra.rb +1 -1
  34. data/lib/david/etsi/optional.rb +4 -0
  35. data/lib/david/etsi/optional/rack.rb +26 -0
  36. data/lib/david/registry.rb +5 -3
  37. data/lib/david/server.rb +5 -6
  38. data/lib/david/server/utility.rb +8 -0
  39. data/lib/david/version.rb +1 -1
  40. data/spec/interop/mandatory_spec.rb +5 -9
  41. data/spec/interop/optional_spec.rb +113 -0
  42. data/spec/spec_helper.rb +1 -1
  43. metadata +35 -10
  44. data/benchmarks/plot.r +0 -24
  45. data/lib/david/interop.rb +0 -4
  46. data/lib/david/interop/mandatory_etsi.rb +0 -4
@@ -0,0 +1,113 @@
1
+ require 'spec_helper'
2
+
3
+ [
4
+ ETSI::Optional::Rack,
5
+ ].each do |app|
6
+ describe "ETSI Plugstests, Optional, #{app.to_s.split('::').last}" do
7
+ let!(:server) { supervised_server(:MinimalMapping => true, app: app) }
8
+
9
+ context 'TD_COAP_BLOCK_01' do
10
+ it 'block 0' do
11
+ mid, response = req(:get, '/large', block2: 0) # 0, false, 16
12
+ block = CoAP::Block.new(response.options[:block2]).decode
13
+
14
+ expect(response).to be_a(CoAP::Message)
15
+ expect(response.mcode).to eq([2, 5])
16
+ expect(response.mid).to eq(mid)
17
+ expect(response.payload.size).to eq(16)
18
+ expect(block.num).to eq(0)
19
+ expect(block.more).to eq(true)
20
+ expect(block.size).to eq(16)
21
+ end
22
+
23
+ it 'block 1' do
24
+ mid, response = req(:get, '/large', block2: 16) # 1, false, 16
25
+ block = CoAP::Block.new(response.options[:block2]).decode
26
+
27
+ expect(response).to be_a(CoAP::Message)
28
+ expect(response.mcode).to eq([2, 5])
29
+ expect(response.mid).to eq(mid)
30
+ expect(response.payload.size).to eq(16)
31
+ expect(block.num).to eq(1)
32
+ expect(block.more).to eq(true)
33
+ expect(block.size).to eq(16)
34
+ end
35
+
36
+ it 'block 64' do
37
+ mid, response = req(:get, '/large', block2: 1024) # 65, false, 16
38
+ block = CoAP::Block.new(response.options[:block2]).decode
39
+
40
+ expect(response).to be_a(CoAP::Message)
41
+ expect(response.mcode).to eq([2, 5])
42
+ expect(response.mid).to eq(mid)
43
+ expect(response.payload.size).to eq(1)
44
+ expect(block.num).to eq(64)
45
+ expect(block.more).to eq(false)
46
+ expect(block.size).to eq(16)
47
+ end
48
+
49
+ end
50
+
51
+ context 'TD_COAP_BLOCK_02' do
52
+ it 'block 0' do
53
+ mid, response = req(:get, '/large')
54
+ block = CoAP::Block.new(response.options[:block2]).decode
55
+
56
+ expect(response).to be_a(CoAP::Message)
57
+ expect(response.mcode).to eq([2, 5])
58
+ expect(response.mid).to eq(mid)
59
+ expect(response.payload.size).to eq(1024)
60
+ expect(block.num).to eq(0)
61
+ expect(block.more).to eq(true)
62
+ expect(block.size).to eq(1024)
63
+ end
64
+
65
+ it 'block 1' do
66
+ mid, response = req(:get, '/large', block2: 22) # 1, false, 1024
67
+ block = CoAP::Block.new(response.options[:block2]).decode
68
+
69
+ expect(response).to be_a(CoAP::Message)
70
+ expect(response.mcode).to eq([2, 5])
71
+ expect(response.mid).to eq(mid)
72
+ expect(response.payload.size).to eq(1)
73
+ expect(block.num).to eq(1)
74
+ expect(block.more).to eq(false)
75
+ expect(block.size).to eq(1024)
76
+ end
77
+ end
78
+
79
+ describe 'TD_COAP_OBS_01' do
80
+ before do
81
+ @answers = []
82
+
83
+ @t1 = Thread.start do
84
+ CoAP::Client.new.observe \
85
+ '/obs', '::1', nil,
86
+ ->(s, m) { @answers << m }
87
+ end
88
+
89
+ Timeout.timeout(12) do
90
+ sleep 0.25 while !(@answers.size > 2)
91
+ end
92
+ end
93
+
94
+ it 'responses' do
95
+ expect(@answers.size).to be > 2
96
+ @answers.each do |answer|
97
+ obs = answer.options[:observe]
98
+ expect(obs).not_to eq(nil)
99
+ expect(obs).to be >= 0
100
+ expect(obs).to be <= 2
101
+ end
102
+ end
103
+
104
+ after do
105
+ @t1.kill
106
+ end
107
+ end
108
+
109
+ after do
110
+ server.terminate
111
+ end
112
+ end
113
+ end
@@ -13,7 +13,7 @@ require 'rspec/rails'
13
13
  $:.unshift(File.expand_path('../lib', File.dirname(__FILE__)))
14
14
 
15
15
  require 'david'
16
- require 'david/interop'
16
+ require 'david/etsi'
17
17
 
18
18
  module David
19
19
  module TestHelper
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: david
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - henning mueller
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-11 00:00:00.000000000 Z
11
+ date: 2015-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: celluloid-io
@@ -107,11 +107,32 @@ files:
107
107
  - benchmarks/Gemfile
108
108
  - benchmarks/Gemfile.lock
109
109
  - benchmarks/coapbench.sh
110
- - benchmarks/plot.r
110
+ - benchmarks/data/jruby-1.7.19-rack
111
+ - benchmarks/data/jruby-1.7.19-rack.csv
112
+ - benchmarks/data/jruby-1.7.19-rails
113
+ - benchmarks/data/jruby-1.7.19-rails.csv
114
+ - benchmarks/data/jruby-9.0.0.0-pre1-rack
115
+ - benchmarks/data/jruby-9.0.0.0-pre1-rack.csv
116
+ - benchmarks/data/jruby-9.0.0.0-pre1-rails
117
+ - benchmarks/data/jruby-9.0.0.0-pre1-rails.csv
118
+ - benchmarks/data/mri-2.2.0p0-rack
119
+ - benchmarks/data/mri-2.2.0p0-rack.csv
120
+ - benchmarks/data/mri-2.2.0p0-rails
121
+ - benchmarks/data/mri-2.2.0p0-rails.csv
122
+ - benchmarks/data/mri-2.3.0-dev-rack
123
+ - benchmarks/data/mri-2.3.0-dev-rack.csv
124
+ - benchmarks/data/mri-2.3.0-dev-rails
125
+ - benchmarks/data/mri-2.3.0-dev-rails.csv
126
+ - benchmarks/interop.sh
127
+ - benchmarks/max.rb
128
+ - benchmarks/plot.frameworks.r
129
+ - benchmarks/plot.loss.r
130
+ - benchmarks/plot.vms.r
111
131
  - benchmarks/quick.sh
112
132
  - benchmarks/rackup/Gemfile
113
133
  - benchmarks/rackup/Gemfile.lock
114
134
  - benchmarks/rackup/grape.ru
135
+ - benchmarks/rackup/interop.ru
115
136
  - benchmarks/rackup/rack.ru
116
137
  - benchmarks/rackup/rails.ru
117
138
  - benchmarks/rps.rb
@@ -133,18 +154,20 @@ files:
133
154
  - lib/david.rb
134
155
  - lib/david/actor.rb
135
156
  - lib/david/app_config.rb
157
+ - lib/david/etsi.rb
158
+ - lib/david/etsi/mandatory.rb
159
+ - lib/david/etsi/mandatory/grape.rb
160
+ - lib/david/etsi/mandatory/hobbit.rb
161
+ - lib/david/etsi/mandatory/nyny.rb
162
+ - lib/david/etsi/mandatory/rack.rb
163
+ - lib/david/etsi/mandatory/sinatra.rb
164
+ - lib/david/etsi/optional.rb
165
+ - lib/david/etsi/optional/rack.rb
136
166
  - lib/david/exchange.rb
137
167
  - lib/david/fake_logger.rb
138
168
  - lib/david/garbage_collector.rb
139
169
  - lib/david/guerilla/rack/handler.rb
140
170
  - lib/david/guerilla/rack/utils.rb
141
- - lib/david/interop.rb
142
- - lib/david/interop/mandatory_etsi.rb
143
- - lib/david/interop/mandatory_etsi/grape.rb
144
- - lib/david/interop/mandatory_etsi/hobbit.rb
145
- - lib/david/interop/mandatory_etsi/nyny.rb
146
- - lib/david/interop/mandatory_etsi/rack.rb
147
- - lib/david/interop/mandatory_etsi/sinatra.rb
148
171
  - lib/david/observe.rb
149
172
  - lib/david/rails/action_controller/base.rb
150
173
  - lib/david/railties/config.rb
@@ -211,6 +234,7 @@ files:
211
234
  - spec/dummy/public/favicon.ico
212
235
  - spec/guerilla_rack_handler_spec.rb
213
236
  - spec/interop/mandatory_spec.rb
237
+ - spec/interop/optional_spec.rb
214
238
  - spec/mapping_spec.rb
215
239
  - spec/observe_spec.rb
216
240
  - spec/perf/server_perf_spec.rb
@@ -288,6 +312,7 @@ test_files:
288
312
  - spec/dummy/public/favicon.ico
289
313
  - spec/guerilla_rack_handler_spec.rb
290
314
  - spec/interop/mandatory_spec.rb
315
+ - spec/interop/optional_spec.rb
291
316
  - spec/mapping_spec.rb
292
317
  - spec/observe_spec.rb
293
318
  - spec/perf/server_perf_spec.rb
@@ -1,24 +0,0 @@
1
- #!/usr/lib/R/bin/Rscript
2
-
3
- library(methods)
4
- library(ggplot2)
5
-
6
- args = commandArgs(TRUE)
7
- values = read.table(file=args[1], sep=",", header=T)
8
-
9
- x = values$concurrent
10
- y1 = values$throughput
11
- y2 = values$loss
12
-
13
- df = data.frame(x, y1)
14
-
15
- g = ggplot(df, aes(x, y1)) +
16
- scale_x_log10() +
17
- geom_line(aes(y=y1)) +
18
- ylab("Requests per second") +
19
- xlab("Concurrent clients (log.)") +
20
- theme(panel.background = element_rect(fill='white', colour='black'))
21
-
22
- path = paste(args[1], "pdf", sep=".")
23
- print(path)
24
- ggsave(g, file=path)
@@ -1,4 +0,0 @@
1
- module David::Interop
2
- end
3
-
4
- require 'david/interop/mandatory_etsi'
@@ -1,4 +0,0 @@
1
- module David::Interop::MandatoryETSI
2
- path = File.expand_path('../mandatory_etsi', __FILE__)
3
- Dir["#{path}/*.rb"].each { |file| require file }
4
- end