simple_benchmarks 0.1.0.alpha
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.document +5 -0
- data/.rspec +2 -0
- data/.semver +5 -0
- data/Gemfile +21 -0
- data/Gemfile.lock +141 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +12 -0
- data/Rakefile +60 -0
- data/lib/simple_benchmarks.rb +13 -0
- data/lib/simple_benchmarks/metrics.rb +135 -0
- data/simple_benchmarks.gemspec +97 -0
- data/spec/spec_helper.rb +89 -0
- metadata +281 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: bdc011824ddd2f53a55ae749dfef86bb29384fb4
|
4
|
+
data.tar.gz: 2e1a104714ed81e1cec14b2d6e83f671b48fd906
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7f7cb965eb767d551d97c613794f2fe8d579525481f0929e3cb750392bd4e5245ac5f93cfdcfc9a4b7427f4309e411f0a00216692e1f06c65c0645012c109c4c
|
7
|
+
data.tar.gz: 97aaf0f3e002962163fa1eb98e0911e924e59cadbd850696d3c535df96aa2cf6b9022b49550b0649595adf595f7fa981790c57a6b6fa5306ae884a567dd3363e
|
data/.document
ADDED
data/.rspec
ADDED
data/.semver
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
|
3
|
+
gem "redis" #, "~> 3.0.1"
|
4
|
+
gem "hiredis" #, "~> 0.4.5"
|
5
|
+
|
6
|
+
group :development do
|
7
|
+
gem "rspec", '~> 3'
|
8
|
+
gem "shoulda", ">= 0"
|
9
|
+
gem "rdoc", "~> 3.12"
|
10
|
+
gem "yard", "~> 0"
|
11
|
+
gem "bundler", "~> 1.0"
|
12
|
+
gem "jeweler", "~> 2.0.1"
|
13
|
+
gem "simplecov", ">= 0"
|
14
|
+
gem 'semver', '~> 1'
|
15
|
+
gem 'pry'
|
16
|
+
gem 'pry-doc'
|
17
|
+
gem 'pry-byebug'
|
18
|
+
gem 'pry-remote'
|
19
|
+
gem 'pry-rescue'
|
20
|
+
gem 'pry-stack_explorer'
|
21
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,141 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
activesupport (4.2.0)
|
5
|
+
i18n (~> 0.7)
|
6
|
+
json (~> 1.7, >= 1.7.7)
|
7
|
+
minitest (~> 5.1)
|
8
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
9
|
+
tzinfo (~> 1.1)
|
10
|
+
addressable (2.3.7)
|
11
|
+
binding_of_caller (0.7.2)
|
12
|
+
debug_inspector (>= 0.0.1)
|
13
|
+
builder (3.2.2)
|
14
|
+
byebug (3.5.1)
|
15
|
+
columnize (~> 0.8)
|
16
|
+
debugger-linecache (~> 1.2)
|
17
|
+
slop (~> 3.6)
|
18
|
+
coderay (1.1.0)
|
19
|
+
columnize (0.9.0)
|
20
|
+
debug_inspector (0.0.2)
|
21
|
+
debugger-linecache (1.2.0)
|
22
|
+
descendants_tracker (0.0.4)
|
23
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
24
|
+
diff-lcs (1.2.5)
|
25
|
+
docile (1.1.5)
|
26
|
+
faraday (0.9.1)
|
27
|
+
multipart-post (>= 1.2, < 3)
|
28
|
+
git (1.2.9.1)
|
29
|
+
github_api (0.12.3)
|
30
|
+
addressable (~> 2.3)
|
31
|
+
descendants_tracker (~> 0.0.4)
|
32
|
+
faraday (~> 0.8, < 0.10)
|
33
|
+
hashie (>= 3.3)
|
34
|
+
multi_json (>= 1.7.5, < 2.0)
|
35
|
+
nokogiri (~> 1.6.3)
|
36
|
+
oauth2
|
37
|
+
hashie (3.4.0)
|
38
|
+
highline (1.7.1)
|
39
|
+
hiredis (0.6.0)
|
40
|
+
i18n (0.7.0)
|
41
|
+
interception (0.5)
|
42
|
+
jeweler (2.0.1)
|
43
|
+
builder
|
44
|
+
bundler (>= 1.0)
|
45
|
+
git (>= 1.2.5)
|
46
|
+
github_api
|
47
|
+
highline (>= 1.6.15)
|
48
|
+
nokogiri (>= 1.5.10)
|
49
|
+
rake
|
50
|
+
rdoc
|
51
|
+
json (1.8.2)
|
52
|
+
jwt (1.4.0)
|
53
|
+
method_source (0.8.2)
|
54
|
+
mini_portile (0.6.2)
|
55
|
+
minitest (5.5.1)
|
56
|
+
multi_json (1.11.0)
|
57
|
+
multi_xml (0.5.5)
|
58
|
+
multipart-post (2.0.0)
|
59
|
+
nokogiri (1.6.6.2)
|
60
|
+
mini_portile (~> 0.6.0)
|
61
|
+
oauth2 (1.0.0)
|
62
|
+
faraday (>= 0.8, < 0.10)
|
63
|
+
jwt (~> 1.0)
|
64
|
+
multi_json (~> 1.3)
|
65
|
+
multi_xml (~> 0.5)
|
66
|
+
rack (~> 1.2)
|
67
|
+
pry (0.10.1)
|
68
|
+
coderay (~> 1.1.0)
|
69
|
+
method_source (~> 0.8.1)
|
70
|
+
slop (~> 3.4)
|
71
|
+
pry-byebug (3.0.1)
|
72
|
+
byebug (~> 3.4)
|
73
|
+
pry (~> 0.10)
|
74
|
+
pry-doc (0.6.0)
|
75
|
+
pry (~> 0.9)
|
76
|
+
yard (~> 0.8)
|
77
|
+
pry-remote (0.1.8)
|
78
|
+
pry (~> 0.9)
|
79
|
+
slop (~> 3.0)
|
80
|
+
pry-rescue (1.4.1)
|
81
|
+
interception (>= 0.5)
|
82
|
+
pry
|
83
|
+
pry-stack_explorer (0.4.9.2)
|
84
|
+
binding_of_caller (>= 0.7)
|
85
|
+
pry (>= 0.9.11)
|
86
|
+
rack (1.6.0)
|
87
|
+
rake (10.4.2)
|
88
|
+
rdoc (3.12.2)
|
89
|
+
json (~> 1.4)
|
90
|
+
redis (3.2.1)
|
91
|
+
rspec (3.2.0)
|
92
|
+
rspec-core (~> 3.2.0)
|
93
|
+
rspec-expectations (~> 3.2.0)
|
94
|
+
rspec-mocks (~> 3.2.0)
|
95
|
+
rspec-core (3.2.2)
|
96
|
+
rspec-support (~> 3.2.0)
|
97
|
+
rspec-expectations (3.2.0)
|
98
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
99
|
+
rspec-support (~> 3.2.0)
|
100
|
+
rspec-mocks (3.2.1)
|
101
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
102
|
+
rspec-support (~> 3.2.0)
|
103
|
+
rspec-support (3.2.2)
|
104
|
+
semver (1.0.1)
|
105
|
+
shoulda (3.5.0)
|
106
|
+
shoulda-context (~> 1.0, >= 1.0.1)
|
107
|
+
shoulda-matchers (>= 1.4.1, < 3.0)
|
108
|
+
shoulda-context (1.2.1)
|
109
|
+
shoulda-matchers (2.8.0)
|
110
|
+
activesupport (>= 3.0.0)
|
111
|
+
simplecov (0.9.2)
|
112
|
+
docile (~> 1.1.0)
|
113
|
+
multi_json (~> 1.0)
|
114
|
+
simplecov-html (~> 0.9.0)
|
115
|
+
simplecov-html (0.9.0)
|
116
|
+
slop (3.6.0)
|
117
|
+
thread_safe (0.3.5)
|
118
|
+
tzinfo (1.2.2)
|
119
|
+
thread_safe (~> 0.1)
|
120
|
+
yard (0.8.7.6)
|
121
|
+
|
122
|
+
PLATFORMS
|
123
|
+
ruby
|
124
|
+
|
125
|
+
DEPENDENCIES
|
126
|
+
bundler (~> 1.0)
|
127
|
+
hiredis
|
128
|
+
jeweler (~> 2.0.1)
|
129
|
+
pry
|
130
|
+
pry-byebug
|
131
|
+
pry-doc
|
132
|
+
pry-remote
|
133
|
+
pry-rescue
|
134
|
+
pry-stack_explorer
|
135
|
+
rdoc (~> 3.12)
|
136
|
+
redis
|
137
|
+
rspec (~> 3)
|
138
|
+
semver (~> 1)
|
139
|
+
shoulda
|
140
|
+
simplecov
|
141
|
+
yard (~> 0)
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2015 Fred Mitchell
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
require 'semver'
|
6
|
+
|
7
|
+
def s_version
|
8
|
+
SemVer.find.format "%M.%m.%p%s"
|
9
|
+
end
|
10
|
+
|
11
|
+
begin
|
12
|
+
Bundler.setup(:default, :development)
|
13
|
+
rescue Bundler::BundlerError => e
|
14
|
+
$stderr.puts e.message
|
15
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
16
|
+
exit e.status_code
|
17
|
+
end
|
18
|
+
require 'rake'
|
19
|
+
|
20
|
+
require 'jeweler'
|
21
|
+
Jeweler::Tasks.new do |gem|
|
22
|
+
# gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
|
23
|
+
gem.name = "simple_benchmarks"
|
24
|
+
gem.homepage = "http://github.com/flajann2/simple_benchmarks"
|
25
|
+
|
26
|
+
gem.version = s_version
|
27
|
+
gem.license = "MIT License"
|
28
|
+
|
29
|
+
gem.summary = %Q{Metrics}
|
30
|
+
gem.description = %Q{Metrics and Benchmarks of your app.}
|
31
|
+
gem.email = "lordalveric@gmx.de"
|
32
|
+
gem.authors = ["Fred Mitchell"]
|
33
|
+
# dependencies defined in Gemfile
|
34
|
+
end
|
35
|
+
Jeweler::RubygemsDotOrgTasks.new
|
36
|
+
|
37
|
+
require 'rake/testtask'
|
38
|
+
Rake::TestTask.new(:test) do |test|
|
39
|
+
test.libs << 'lib' << 'test'
|
40
|
+
test.pattern = 'test/**/test_*.rb'
|
41
|
+
test.verbose = true
|
42
|
+
end
|
43
|
+
|
44
|
+
desc "Code coverage detail"
|
45
|
+
task :simplecov do
|
46
|
+
ENV['COVERAGE'] = "true"
|
47
|
+
Rake::Task['test'].execute
|
48
|
+
end
|
49
|
+
|
50
|
+
task :default => :spec
|
51
|
+
|
52
|
+
require 'rdoc/task'
|
53
|
+
Rake::RDocTask.new do |rdoc|
|
54
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
55
|
+
|
56
|
+
rdoc.rdoc_dir = 'rdoc'
|
57
|
+
rdoc.title = "Simple Benchmarks #{version}"
|
58
|
+
rdoc.rdoc_files.include('README*')
|
59
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
60
|
+
end
|
@@ -0,0 +1,135 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
module Simple
|
3
|
+
|
4
|
+
# Metrics keeper and reporter mixin
|
5
|
+
module Metrics
|
6
|
+
# timeout of the redis queue in seconds
|
7
|
+
QUEUE_TIMEOUT = 1800
|
8
|
+
|
9
|
+
class << self
|
10
|
+
def included(klazz)
|
11
|
+
@@usedin = [] if defined?(@@usedin).nil?
|
12
|
+
@@usedin << klazz
|
13
|
+
@@counters = {} if defined?(@@counters).nil?
|
14
|
+
@@tally = {} if defined?(@@tally).nil?
|
15
|
+
@@start_time = DateTime.now if defined?(@@start_time).nil?
|
16
|
+
@@bulk_times = []
|
17
|
+
@@general_timer = {}
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
# Count one on the basis of the tag.
|
22
|
+
# if the datum is given, we simply pass it through.
|
23
|
+
def tick(datum = nil, tag: nil)
|
24
|
+
tag = caller_locations(1,1).first.inspect if tag.nil?
|
25
|
+
@@counters[tag] ||= 0
|
26
|
+
@@counters[tag] += 1
|
27
|
+
datum
|
28
|
+
end
|
29
|
+
|
30
|
+
# Measure the time a job takes.
|
31
|
+
# This will allow us to get pretty fine-grained.
|
32
|
+
def measure(tag, &block)
|
33
|
+
@@general_timer[tag] ||= []
|
34
|
+
before = Time.now
|
35
|
+
ret = block.()
|
36
|
+
after = Time.now
|
37
|
+
@@general_timer[tag] << [before, after - before]
|
38
|
+
ret
|
39
|
+
end
|
40
|
+
|
41
|
+
# Aspect-invoked when bulk#execute is called.
|
42
|
+
# The Time objects are expected here.
|
43
|
+
def bulk_execute_tick(before, after)
|
44
|
+
@@bulk_times << [before, after - before]
|
45
|
+
end
|
46
|
+
|
47
|
+
|
48
|
+
# Tally up object totals.
|
49
|
+
def tally(ob: nil, count: 1)
|
50
|
+
@@tally[ob] ||= 0
|
51
|
+
@@tally[ob] += count
|
52
|
+
end
|
53
|
+
|
54
|
+
def get_counters; @@counters; end
|
55
|
+
def get_usedin; @@usedin; end
|
56
|
+
def get_tally; @@tally; end
|
57
|
+
def get_start_time; @@start_time; end
|
58
|
+
def get_bulk_times; @@bulk_times; end
|
59
|
+
def get_general_timer; @@general_timer; end
|
60
|
+
|
61
|
+
def init_report_database
|
62
|
+
@@redis = Redis.new(:driver => :hiredis)
|
63
|
+
end
|
64
|
+
|
65
|
+
def update_report_database
|
66
|
+
@@redis.lpush :metrics, get_general_timer.to_json
|
67
|
+
end
|
68
|
+
|
69
|
+
def get_general_timer_from_database(forks, tout, skip)
|
70
|
+
forks.times.map{ |i|
|
71
|
+
json = @@redis.brpop(:metrics, timeout: tout)
|
72
|
+
json = json.last unless json.nil?
|
73
|
+
unless json.nil?
|
74
|
+
JSON.parse json
|
75
|
+
else
|
76
|
+
mess = "Timed out waiting for queue (#{tout} sec, fork #{i})."
|
77
|
+
if skip
|
78
|
+
puts mess
|
79
|
+
nil
|
80
|
+
else
|
81
|
+
raise mess
|
82
|
+
end
|
83
|
+
end
|
84
|
+
}.compact.inject({}){ |memo, h|
|
85
|
+
h.each{|key, ar|
|
86
|
+
memo[key] ||= []
|
87
|
+
memo[key] += ar
|
88
|
+
}
|
89
|
+
memo
|
90
|
+
}
|
91
|
+
end
|
92
|
+
|
93
|
+
def render_report(forks, timeout = QUEUE_TIMEOUT, skip = false)
|
94
|
+
gr = nil
|
95
|
+
metrics = [
|
96
|
+
'Report Metrics',
|
97
|
+
gr = {general_report:
|
98
|
+
get_general_timer_from_database(forks, timeout, skip).inject({}){ |mm, (tag, timings)|
|
99
|
+
t = timings.reduce(Hash.new(0)){ |memo, (stamp, duration) |
|
100
|
+
memo[:opsec] = Hash.new(0) unless memo[:opsec].kind_of? Hash
|
101
|
+
memo[:opsec][DateTime.parse(stamp).to_time.to_i] += 1
|
102
|
+
memo[:total] += duration
|
103
|
+
memo[:highest] = duration unless memo[:highest] > duration
|
104
|
+
memo[:lowest] = 1.0/0.0 if memo[:lowest].kind_of? Fixnum
|
105
|
+
memo[:lowest] = (duration * 1.0) unless memo[:lowest] < duration
|
106
|
+
memo
|
107
|
+
}
|
108
|
+
t[:opsec] = t[:opsec].values.inject(:+) * 1.0 / t[:opsec].size
|
109
|
+
t[:tag] = tag
|
110
|
+
t[:count] = timings.size * 1.0
|
111
|
+
t[:average] = t[:total] / t[:count]
|
112
|
+
t[:variance] = timings.reduce(0.0){ | memo, (ignore, duration) |
|
113
|
+
e = duration - t[:average]
|
114
|
+
memo += e*e
|
115
|
+
} / t[:count]
|
116
|
+
t[:sd] = Math.sqrt t[:variance]
|
117
|
+
mm[tag] = t
|
118
|
+
mm
|
119
|
+
}.map{ |tag, t|
|
120
|
+
sprintf "%15<tag>s | %9<count>d |%7.3<average>f |%7.3<highest>f |%7.3<lowest>f |%7.3<sd>f | %9.3<total>f | %7.1<opsec>f " % t
|
121
|
+
}.unshift(" TAGS | COUNT | AVE |HIGHEST | LOWEST | SD | TOTDUR | ops/sec")
|
122
|
+
.join("\n")
|
123
|
+
},
|
124
|
+
"Running time: %5.3f minutes" % [(DateTime.now - get_start_time).to_f * 24 * 60],
|
125
|
+
gr[:general_report]
|
126
|
+
]
|
127
|
+
puts( unless env.verbose
|
128
|
+
metrics[-2..-1]
|
129
|
+
else
|
130
|
+
metrics
|
131
|
+
end.join("\n" + '#' * 87 + "\n"))
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
@@ -0,0 +1,97 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: simple_benchmarks 0.1.0.alpha ruby lib
|
6
|
+
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = "simple_benchmarks"
|
9
|
+
s.version = "0.1.0.alpha"
|
10
|
+
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib"]
|
13
|
+
s.authors = ["Fred Mitchell"]
|
14
|
+
s.date = "2015-03-12"
|
15
|
+
s.description = "Metrics and Benchmarks of your app."
|
16
|
+
s.email = "lordalveric@gmx.de"
|
17
|
+
s.extra_rdoc_files = [
|
18
|
+
"LICENSE.txt",
|
19
|
+
"README.rdoc"
|
20
|
+
]
|
21
|
+
s.files = [
|
22
|
+
".document",
|
23
|
+
".rspec",
|
24
|
+
".semver",
|
25
|
+
"Gemfile",
|
26
|
+
"Gemfile.lock",
|
27
|
+
"LICENSE.txt",
|
28
|
+
"README.rdoc",
|
29
|
+
"Rakefile",
|
30
|
+
"lib/simple_benchmarks.rb",
|
31
|
+
"lib/simple_benchmarks/metrics.rb",
|
32
|
+
"simple_benchmarks.gemspec",
|
33
|
+
"spec/spec_helper.rb"
|
34
|
+
]
|
35
|
+
s.homepage = "http://github.com/flajann2/simple_benchmarks"
|
36
|
+
s.licenses = ["MIT License"]
|
37
|
+
s.rubygems_version = "2.4.5"
|
38
|
+
s.summary = "Metrics"
|
39
|
+
|
40
|
+
if s.respond_to? :specification_version then
|
41
|
+
s.specification_version = 4
|
42
|
+
|
43
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
44
|
+
s.add_runtime_dependency(%q<redis>, [">= 0"])
|
45
|
+
s.add_runtime_dependency(%q<hiredis>, [">= 0"])
|
46
|
+
s.add_development_dependency(%q<rspec>, ["~> 3"])
|
47
|
+
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
48
|
+
s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
|
49
|
+
s.add_development_dependency(%q<yard>, ["~> 0"])
|
50
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0"])
|
51
|
+
s.add_development_dependency(%q<jeweler>, ["~> 2.0.1"])
|
52
|
+
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
53
|
+
s.add_development_dependency(%q<semver>, ["~> 1"])
|
54
|
+
s.add_development_dependency(%q<pry>, [">= 0"])
|
55
|
+
s.add_development_dependency(%q<pry-doc>, [">= 0"])
|
56
|
+
s.add_development_dependency(%q<pry-byebug>, [">= 0"])
|
57
|
+
s.add_development_dependency(%q<pry-remote>, [">= 0"])
|
58
|
+
s.add_development_dependency(%q<pry-rescue>, [">= 0"])
|
59
|
+
s.add_development_dependency(%q<pry-stack_explorer>, [">= 0"])
|
60
|
+
else
|
61
|
+
s.add_dependency(%q<redis>, [">= 0"])
|
62
|
+
s.add_dependency(%q<hiredis>, [">= 0"])
|
63
|
+
s.add_dependency(%q<rspec>, ["~> 3"])
|
64
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
65
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
66
|
+
s.add_dependency(%q<yard>, ["~> 0"])
|
67
|
+
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
68
|
+
s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
|
69
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
70
|
+
s.add_dependency(%q<semver>, ["~> 1"])
|
71
|
+
s.add_dependency(%q<pry>, [">= 0"])
|
72
|
+
s.add_dependency(%q<pry-doc>, [">= 0"])
|
73
|
+
s.add_dependency(%q<pry-byebug>, [">= 0"])
|
74
|
+
s.add_dependency(%q<pry-remote>, [">= 0"])
|
75
|
+
s.add_dependency(%q<pry-rescue>, [">= 0"])
|
76
|
+
s.add_dependency(%q<pry-stack_explorer>, [">= 0"])
|
77
|
+
end
|
78
|
+
else
|
79
|
+
s.add_dependency(%q<redis>, [">= 0"])
|
80
|
+
s.add_dependency(%q<hiredis>, [">= 0"])
|
81
|
+
s.add_dependency(%q<rspec>, ["~> 3"])
|
82
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
83
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
84
|
+
s.add_dependency(%q<yard>, ["~> 0"])
|
85
|
+
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
86
|
+
s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
|
87
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
88
|
+
s.add_dependency(%q<semver>, ["~> 1"])
|
89
|
+
s.add_dependency(%q<pry>, [">= 0"])
|
90
|
+
s.add_dependency(%q<pry-doc>, [">= 0"])
|
91
|
+
s.add_dependency(%q<pry-byebug>, [">= 0"])
|
92
|
+
s.add_dependency(%q<pry-remote>, [">= 0"])
|
93
|
+
s.add_dependency(%q<pry-rescue>, [">= 0"])
|
94
|
+
s.add_dependency(%q<pry-stack_explorer>, [">= 0"])
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
2
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause this
|
4
|
+
# file to always be loaded, without a need to explicitly require it in any files.
|
5
|
+
#
|
6
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
7
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
8
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
9
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
10
|
+
# a separate helper file that requires the additional dependencies and performs
|
11
|
+
# the additional setup, and require it from the spec files that actually need it.
|
12
|
+
#
|
13
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
14
|
+
# users commonly want.
|
15
|
+
#
|
16
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
17
|
+
RSpec.configure do |config|
|
18
|
+
# rspec-expectations config goes here. You can use an alternate
|
19
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
20
|
+
# assertions if you prefer.
|
21
|
+
config.expect_with :rspec do |expectations|
|
22
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
23
|
+
# and `failure_message` of custom matchers include text for helper methods
|
24
|
+
# defined using `chain`, e.g.:
|
25
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
26
|
+
# # => "be bigger than 2 and smaller than 4"
|
27
|
+
# ...rather than:
|
28
|
+
# # => "be bigger than 2"
|
29
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
30
|
+
end
|
31
|
+
|
32
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
33
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
34
|
+
config.mock_with :rspec do |mocks|
|
35
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
36
|
+
# a real object. This is generally recommended, and will default to
|
37
|
+
# `true` in RSpec 4.
|
38
|
+
mocks.verify_partial_doubles = true
|
39
|
+
end
|
40
|
+
|
41
|
+
# The settings below are suggested to provide a good initial experience
|
42
|
+
# with RSpec, but feel free to customize to your heart's content.
|
43
|
+
=begin
|
44
|
+
# These two settings work together to allow you to limit a spec run
|
45
|
+
# to individual examples or groups you care about by tagging them with
|
46
|
+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
47
|
+
# get run.
|
48
|
+
config.filter_run :focus
|
49
|
+
config.run_all_when_everything_filtered = true
|
50
|
+
|
51
|
+
# Limits the available syntax to the non-monkey patched syntax that is recommended.
|
52
|
+
# For more details, see:
|
53
|
+
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
54
|
+
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
55
|
+
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
|
56
|
+
config.disable_monkey_patching!
|
57
|
+
|
58
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
59
|
+
# be too noisy due to issues in dependencies.
|
60
|
+
config.warnings = true
|
61
|
+
|
62
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
63
|
+
# file, and it's useful to allow more verbose output when running an
|
64
|
+
# individual spec file.
|
65
|
+
if config.files_to_run.one?
|
66
|
+
# Use the documentation formatter for detailed output,
|
67
|
+
# unless a formatter has already been configured
|
68
|
+
# (e.g. via a command-line flag).
|
69
|
+
config.default_formatter = 'doc'
|
70
|
+
end
|
71
|
+
|
72
|
+
# Print the 10 slowest examples and example groups at the
|
73
|
+
# end of the spec run, to help surface which specs are running
|
74
|
+
# particularly slow.
|
75
|
+
config.profile_examples = 10
|
76
|
+
|
77
|
+
# Run specs in random order to surface order dependencies. If you find an
|
78
|
+
# order dependency and want to debug it, you can fix the order by providing
|
79
|
+
# the seed, which is printed after each run.
|
80
|
+
# --seed 1234
|
81
|
+
config.order = :random
|
82
|
+
|
83
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
84
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
85
|
+
# test failures related to randomization by passing the same `--seed` value
|
86
|
+
# as the one that triggered the failure.
|
87
|
+
Kernel.srand config.seed
|
88
|
+
=end
|
89
|
+
end
|
metadata
ADDED
@@ -0,0 +1,281 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: simple_benchmarks
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0.alpha
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Fred Mitchell
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-03-12 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: redis
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: hiredis
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: shoulda
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rdoc
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.12'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.12'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: yard
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: bundler
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1.0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: jeweler
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 2.0.1
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 2.0.1
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: simplecov
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: semver
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '1'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '1'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: pry
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: pry-doc
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: pry-byebug
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ">="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0'
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: pry-remote
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - ">="
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '0'
|
202
|
+
type: :development
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - ">="
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '0'
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: pry-rescue
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - ">="
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '0'
|
216
|
+
type: :development
|
217
|
+
prerelease: false
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - ">="
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: '0'
|
223
|
+
- !ruby/object:Gem::Dependency
|
224
|
+
name: pry-stack_explorer
|
225
|
+
requirement: !ruby/object:Gem::Requirement
|
226
|
+
requirements:
|
227
|
+
- - ">="
|
228
|
+
- !ruby/object:Gem::Version
|
229
|
+
version: '0'
|
230
|
+
type: :development
|
231
|
+
prerelease: false
|
232
|
+
version_requirements: !ruby/object:Gem::Requirement
|
233
|
+
requirements:
|
234
|
+
- - ">="
|
235
|
+
- !ruby/object:Gem::Version
|
236
|
+
version: '0'
|
237
|
+
description: Metrics and Benchmarks of your app.
|
238
|
+
email: lordalveric@gmx.de
|
239
|
+
executables: []
|
240
|
+
extensions: []
|
241
|
+
extra_rdoc_files:
|
242
|
+
- LICENSE.txt
|
243
|
+
- README.rdoc
|
244
|
+
files:
|
245
|
+
- ".document"
|
246
|
+
- ".rspec"
|
247
|
+
- ".semver"
|
248
|
+
- Gemfile
|
249
|
+
- Gemfile.lock
|
250
|
+
- LICENSE.txt
|
251
|
+
- README.rdoc
|
252
|
+
- Rakefile
|
253
|
+
- lib/simple_benchmarks.rb
|
254
|
+
- lib/simple_benchmarks/metrics.rb
|
255
|
+
- simple_benchmarks.gemspec
|
256
|
+
- spec/spec_helper.rb
|
257
|
+
homepage: http://github.com/flajann2/simple_benchmarks
|
258
|
+
licenses:
|
259
|
+
- MIT License
|
260
|
+
metadata: {}
|
261
|
+
post_install_message:
|
262
|
+
rdoc_options: []
|
263
|
+
require_paths:
|
264
|
+
- lib
|
265
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
266
|
+
requirements:
|
267
|
+
- - ">="
|
268
|
+
- !ruby/object:Gem::Version
|
269
|
+
version: '0'
|
270
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
271
|
+
requirements:
|
272
|
+
- - ">"
|
273
|
+
- !ruby/object:Gem::Version
|
274
|
+
version: 1.3.1
|
275
|
+
requirements: []
|
276
|
+
rubyforge_project:
|
277
|
+
rubygems_version: 2.4.5
|
278
|
+
signing_key:
|
279
|
+
specification_version: 4
|
280
|
+
summary: Metrics
|
281
|
+
test_files: []
|