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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 86f8bab5896e8a1f18a8a76246bca168a116ce00
4
- data.tar.gz: bcc37574ba51a78538183a7ab475268c4db570e7
3
+ metadata.gz: 600fa704a7b70ff9c0db8f01deee7b82ff03d8de
4
+ data.tar.gz: 454bc8e92f938b714227cc62c4556dbaf0f19135
5
5
  SHA512:
6
- metadata.gz: 3736c0af7a9f50b21128534d74e27476a34ce2531755f5ea12b12dd3ca0462f0f1a5b9006e5a250b68b22de3d4e2153b7a6cacbda3ee52731de21bdf2b561d9c
7
- data.tar.gz: 9eeb2ffb912140ef6acac7d698ae2a69ed67096d56fb156778abbd4fba118e48be45c3aba1864bedfe59d021e458fcb4c58bab71159c59621f1a0e23a97f56b2
6
+ metadata.gz: 16ccd913ee9602cf618880744db0595a83398dc0b484339218ac27b4b02b96edeb757e9dce703d57d00ce400ec34e6df97ec2f8a038aefff8d678060a38894f2
7
+ data.tar.gz: c225945a926df0ffad241c55818950ca2a2c89cedfd1e3bd71bf4452272f43a38a060375eaa02d504e194359d3a8517f4dae39de70f135b9507c7eaad8eb233e
@@ -65,7 +65,7 @@ module ApiBomb
65
65
  start_attack!(path)
66
66
  end
67
67
  when Path::Weighted
68
- @logger.info(paths.report)
68
+ @logger.info(paths.report(base_url))
69
69
  start_attack!(paths)
70
70
  end
71
71
  end
@@ -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),
@@ -14,6 +14,8 @@ class ApiBomb::LambdaHash < SimpleDelegator
14
14
  end
15
15
 
16
16
  def is_lambda?
17
+ return false if self.blank?
18
+
17
19
  self.each do |k,v|
18
20
  if self[k].is_a? self.class
19
21
  return self[k].is_lambda?
@@ -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
- str = "Load generation over random (weighted) urls \n"
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
- str += "#{path} with probability #{weight/sum} \n"
87
+ str_array << "#{Single.new(path).report(base_url)} with probability #{weight/sum} \n"
85
88
  end
86
89
 
87
- return str
90
+ return str_array.join(' ')
88
91
  end
89
92
  end
90
93
  end
@@ -1,3 +1,3 @@
1
1
  module ApiBomb
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
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.2
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-21 00:00:00.000000000 Z
11
+ date: 2015-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: celluloid