api_bomb 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/api_bomb.rb +1 -1
- data/lib/api_bomb/commander.rb +2 -0
- data/lib/api_bomb/lambda_hash.rb +2 -0
- data/lib/api_bomb/path.rb +7 -4
- data/lib/api_bomb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 600fa704a7b70ff9c0db8f01deee7b82ff03d8de
|
4
|
+
data.tar.gz: 454bc8e92f938b714227cc62c4556dbaf0f19135
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16ccd913ee9602cf618880744db0595a83398dc0b484339218ac27b4b02b96edeb757e9dce703d57d00ce400ec34e6df97ec2f8a038aefff8d678060a38894f2
|
7
|
+
data.tar.gz: c225945a926df0ffad241c55818950ca2a2c89cedfd1e3bd71bf4452272f43a38a060375eaa02d504e194359d3a8517f4dae39de70f135b9507c7eaad8eb233e
|
data/lib/api_bomb.rb
CHANGED
data/lib/api_bomb/commander.rb
CHANGED
@@ -39,6 +39,7 @@ private
|
|
39
39
|
logger.info "Requests per minute: #{attack_result[:rpm]}"
|
40
40
|
logger.info "Average response time: #{attack_result[:average_rt]}"
|
41
41
|
logger.info "Standard deviation: #{attack_result[:sd_rq_time]}"
|
42
|
+
logger.info "Percentile 50th: #{attack_result[:percentile_50]}"
|
42
43
|
logger.info "Percentile 90th: #{attack_result[:percentile_90]}"
|
43
44
|
logger.info "Percentile 95th: #{attack_result[:percentile_95]}"
|
44
45
|
logger.info "Percentile 99th: #{attack_result[:percentile_99]}"
|
@@ -54,6 +55,7 @@ private
|
|
54
55
|
rpm: @signaler.fighters_lost / (duration/60.0),
|
55
56
|
average_rt: @signaler.mean_hold_time,
|
56
57
|
sd_rq_time: @signaler.sd_time,
|
58
|
+
percentile_50: @signaler.percentile(50),
|
57
59
|
percentile_90: @signaler.percentile(90),
|
58
60
|
percentile_95: @signaler.percentile(95),
|
59
61
|
percentile_99: @signaler.percentile(99),
|
data/lib/api_bomb/lambda_hash.rb
CHANGED
data/lib/api_bomb/path.rb
CHANGED
@@ -43,6 +43,8 @@ module ApiBomb::Path
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def params_report
|
46
|
+
return '' unless options[:params]
|
47
|
+
|
46
48
|
if options.is_lambda?
|
47
49
|
" with random params like: #{ApiBomb::LambdaHash.hasharize(options)[:params]}"
|
48
50
|
else
|
@@ -76,15 +78,16 @@ module ApiBomb::Path
|
|
76
78
|
Single.new(@weighted_paths.pick)
|
77
79
|
end
|
78
80
|
|
79
|
-
def report
|
81
|
+
def report(base_url)
|
80
82
|
sum = paths.values.sum
|
81
83
|
|
82
|
-
|
84
|
+
str_array = []
|
85
|
+
str_array << "Load generation over random (weighted) urls \n"
|
83
86
|
paths.sort_by {|_key, value| value}.to_h.each do |path, weight|
|
84
|
-
|
87
|
+
str_array << "#{Single.new(path).report(base_url)} with probability #{weight/sum} \n"
|
85
88
|
end
|
86
89
|
|
87
|
-
return
|
90
|
+
return str_array.join(' ')
|
88
91
|
end
|
89
92
|
end
|
90
93
|
end
|
data/lib/api_bomb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: api_bomb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Filippos Vasilakis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: celluloid
|