httperfrb 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,11 +1,5 @@
1
1
  source :rubygems
2
2
  gem 'open4'
3
- gem 'gruff'
4
- gem 'rmagick'
5
-
6
- group :grapher do
7
- gem 'httperfrb-grapher', '0.0.1pre1'
8
- end
9
3
 
10
4
  group :development do
11
5
  gem 'rspec'
data/HISTORY.md CHANGED
@@ -1,6 +1,10 @@
1
1
  HTTPerf.rb
2
2
  ==========
3
3
 
4
+ ### 0.3.2
5
+
6
+ * removed all grapher and verbose handling, as it isn't working as expected
7
+
4
8
  ### 0.3.1
5
9
 
6
10
  * fixing verbose bug
data/README.md CHANGED
@@ -5,9 +5,9 @@ HTTPERF.rb
5
5
 
6
6
  Simple Ruby interface for httperf.
7
7
 
8
- ### Note
8
+ ### Known Issues
9
9
 
10
- Also see: [HTTPerf::Grapher](http://github.com/rubyops/httperfrb-grapher)
10
+ * Verbose handling isn't parsing correctly, but should not cause errors either.
11
11
 
12
12
  ## Installing 'httperf'
13
13
 
@@ -9,19 +9,23 @@ class HTTPerf
9
9
  # @param [String] raw httperf output
10
10
  def self.parse raw
11
11
 
12
- verbose = false
13
12
  lines = raw.split("\n")
14
13
  matches = {}
15
14
 
15
+ # NOTE: commenting out all verbose handling, as the parsed
16
+ # strings do not exist in standard httperf. This code was
17
+ # based off of a custom hacked version.
18
+ #
16
19
  # for verbose matching
17
- verbose_connection_times = []
20
+ #verbose = false
21
+ #verbose_connection_times = []
18
22
 
19
23
  lines.each do |line|
20
24
 
21
- if verbose_expression.match(line)
22
- verbose_connection_times.push($1)
23
- next
24
- end
25
+ #if verbose_expression.match(line)
26
+ #verbose_connection_times.push($1)
27
+ #next
28
+ #end
25
29
 
26
30
  matched = false
27
31
  unless line.empty?
@@ -35,28 +39,28 @@ class HTTPerf
35
39
  end
36
40
  end
37
41
 
38
- unless verbose_connection_times.empty?
39
- percentiles.each do |percentile|
40
- matches["connection_time_#{percentile}_pct".to_sym] = calculate_percentile(percentile, verbose_connection_times)
41
- end
42
- matches[:connection_times] = verbose_connection_times
43
- verbose = true
44
- end
45
-
46
- if verbose
47
- raise "mismatch error occurred" unless expressions.keys.count+percentiles.count+1 == matches.keys.count
48
- else
42
+ #unless verbose_connection_times.empty?
43
+ #percentiles.each do |percentile|
44
+ #matches["connection_time_#{percentile}_pct".to_sym] = calculate_percentile(percentile, verbose_connection_times)
45
+ #end
46
+ #matches[:connection_times] = verbose_connection_times
47
+ #verbose = true
48
+ #end
49
+
50
+ #if verbose
51
+ #raise "mismatch error occurred" unless expressions.keys.count+percentiles.count+1 == matches.keys.count
52
+ #else
49
53
  raise "mismatch error occurred" unless expressions.keys.count == matches.keys.count
50
- end
54
+ #end
51
55
 
52
56
  return matches
53
57
  end
54
58
 
55
59
  protected
56
60
 
57
- def self.verbose_expression
58
- /^Connection lifetime = ([0-9]*?\.?[0-9]+)$/
59
- end
61
+ #def self.verbose_expression
62
+ #/^Connection lifetime = ([0-9]*?\.?[0-9]+)$/
63
+ #end
60
64
 
61
65
  def self.expressions
62
66
  # While this isn't the most efficent way of doing this, it's the most maintainable.
@@ -142,19 +146,19 @@ class HTTPerf
142
146
  }
143
147
  end
144
148
 
145
- def self.percentiles
146
- [ 75, 80, 85, 90, 95, 99 ]
147
- end
149
+ #def self.percentiles
150
+ #[ 75, 80, 85, 90, 95, 99 ]
151
+ #end
148
152
 
149
- private
150
- def self.calculate_percentile percentile, values
151
- v = values.sort
152
- v[percentile_index(percentile, values.count)]
153
- end
153
+ #private
154
+ #def self.calculate_percentile percentile, values
155
+ #v = values.sort
156
+ #v[percentile_index(percentile, values.count)]
157
+ #end
154
158
 
155
- def self.percentile_index percentile, count
156
- ((count/100)*percentile)-1
157
- end
159
+ #def self.percentile_index percentile, count
160
+ #((count/100)*percentile)-1
161
+ #end
158
162
  end
159
163
  end
160
164
 
@@ -1,4 +1,4 @@
1
1
  class HTTPerf
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
4
4
 
data/lib/httperf.rb CHANGED
@@ -4,11 +4,6 @@ require 'open4'
4
4
  require 'httperf/parser'
5
5
  require 'httperf/version'
6
6
 
7
- begin
8
- require 'httperf/grapher'
9
- rescue LoadError
10
- end
11
-
12
7
  class HTTPerf
13
8
 
14
9
  # @return [Boolean] parse flag
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httperfrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-08-13 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &19990820 !ruby/object:Gem::Requirement
16
+ requirement: &17940520 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *19990820
24
+ version_requirements: *17940520
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: simplecov
27
- requirement: &19989840 !ruby/object:Gem::Requirement
27
+ requirement: &17939680 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *19989840
35
+ version_requirements: *17939680
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: yard
38
- requirement: &19988720 !ruby/object:Gem::Requirement
38
+ requirement: &17939000 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *19988720
46
+ version_requirements: *17939000
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: open4
49
- requirement: &19987960 !ruby/object:Gem::Requirement
49
+ requirement: &17938280 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *19987960
57
+ version_requirements: *17938280
58
58
  description: Simple interface for calling httperf via ruby.
59
59
  email:
60
60
  - joshua@mervine.net
@@ -82,7 +82,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
82
82
  version: '0'
83
83
  segments:
84
84
  - 0
85
- hash: -4394276421810491553
85
+ hash: -407478064777664208
86
86
  required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  none: false
88
88
  requirements: