rubyperf 0.0.0 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/perf/no_op_meter.rb +30 -9
- data/lib/rubyperf.rb +12 -12
- data/rubyperf.gemspec +68 -0
- data/test/test_perf_meter.rb +0 -3
- metadata +4 -8
- data/.idea/encodings.xml +0 -5
- data/.idea/misc.xml +0 -11
- data/.idea/modules.xml +0 -9
- data/.idea/rubyperf.iml +0 -15
- data/.idea/vcs.xml +0 -7
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.1.0
|
data/lib/perf/no_op_meter.rb
CHANGED
@@ -5,8 +5,8 @@
|
|
5
5
|
|
6
6
|
module Perf
|
7
7
|
#
|
8
|
-
# This class can be used in substitution to a Perf::
|
9
|
-
# required. It needs to maintain the same API as Perf::
|
8
|
+
# This class can be used in substitution to a Perf::Meter class to avoid overhead when performance measurements is not
|
9
|
+
# required. It needs to maintain the same API as Perf::Meter.
|
10
10
|
#
|
11
11
|
class NoOpMeter
|
12
12
|
|
@@ -18,20 +18,41 @@ module Perf
|
|
18
18
|
|
19
19
|
#############################################################################################################
|
20
20
|
|
21
|
-
def measure(what
|
21
|
+
def measure(what,&code)
|
22
22
|
yield
|
23
23
|
end
|
24
24
|
|
25
|
-
def
|
26
|
-
|
25
|
+
def measure_result(what,&code)
|
26
|
+
yield
|
27
27
|
end
|
28
28
|
|
29
|
-
def
|
30
|
-
|
29
|
+
def method_meters(klass,imethods=[],cmethods=[])
|
30
|
+
yield
|
31
31
|
end
|
32
32
|
|
33
|
-
def
|
34
|
-
|
33
|
+
def measure_instance_method(klass,method_name)
|
34
|
+
end
|
35
|
+
|
36
|
+
def measure_instance_method(klass,method_name)
|
37
|
+
end
|
38
|
+
|
39
|
+
def restore_all_instance_methods(klass)
|
40
|
+
end
|
41
|
+
|
42
|
+
def measure_class_method(klass,method_name)
|
43
|
+
end
|
44
|
+
|
45
|
+
def restore_class_method(klass,method_name)
|
46
|
+
end
|
47
|
+
|
48
|
+
def restore_all_class_methods(klass)
|
49
|
+
end
|
50
|
+
|
51
|
+
def restore_all_methods(klass)
|
52
|
+
end
|
53
|
+
|
54
|
+
def measure_full_path(path,&code)
|
55
|
+
yield
|
35
56
|
end
|
36
57
|
|
37
58
|
end
|
data/lib/rubyperf.rb
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
#
|
2
|
-
#
|
2
|
+
#Copyright (c) 2012 Lorenzo Pasqualis - DreamBox Learning, Inc
|
3
3
|
#
|
4
|
-
#
|
4
|
+
#Project home-page git repository:
|
5
5
|
# https://github.com/lpasqualis/rubyperf
|
6
6
|
#
|
7
|
-
#
|
7
|
+
#Author can be contacted at:
|
8
8
|
# lpasqualis@gmail.com
|
9
9
|
#
|
10
|
-
#
|
10
|
+
#Author's Blog:
|
11
11
|
# http://www.lorenzopasqualis.com
|
12
12
|
#
|
13
|
-
#
|
13
|
+
#License:
|
14
14
|
#
|
15
15
|
# Permission is hereby granted, free of charge, to any person obtaining
|
16
16
|
# a copy of this software and associated documentation files (the
|
@@ -33,16 +33,16 @@
|
|
33
33
|
#
|
34
34
|
#############################################################################
|
35
35
|
#
|
36
|
-
#
|
37
|
-
#
|
38
|
-
#
|
36
|
+
#This gem measures the execution time of blocks of code, methods and expressions.
|
37
|
+
#It generates detailed reports in various formats showing the nested structure
|
38
|
+
#of the measures.
|
39
39
|
#
|
40
|
-
#
|
41
|
-
#
|
40
|
+
#Designed to give tools to drill in the performance of hot code and identify
|
41
|
+
#bottlenecks.
|
42
42
|
#
|
43
|
-
#
|
43
|
+
#Currently available output formats for the report: text, html.
|
44
44
|
#
|
45
|
-
#
|
45
|
+
#Example of use:
|
46
46
|
#
|
47
47
|
# require 'rubyperf'
|
48
48
|
#
|
data/rubyperf.gemspec
ADDED
@@ -0,0 +1,68 @@
|
|
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
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{rubyperf}
|
8
|
+
s.version = "0.1.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["lpasqualis"]
|
12
|
+
s.date = %q{2012-01-13}
|
13
|
+
s.description = %q{Measures the performance of blocks of code, and provide reporting in various formats}
|
14
|
+
s.email = %q{lpasqualis@gmail.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
"Gemfile",
|
22
|
+
"Gemfile.lock",
|
23
|
+
"LICENSE.txt",
|
24
|
+
"README.rdoc",
|
25
|
+
"Rakefile",
|
26
|
+
"VERSION",
|
27
|
+
"lib/perf/meter.rb",
|
28
|
+
"lib/perf/meter_factory.rb",
|
29
|
+
"lib/perf/no_op_meter.rb",
|
30
|
+
"lib/perf/noop_measure.rb",
|
31
|
+
"lib/perf/report_format.rb",
|
32
|
+
"lib/perf/report_format_html.rb",
|
33
|
+
"lib/perf/report_format_simple.rb",
|
34
|
+
"lib/rubyperf.rb",
|
35
|
+
"rubyperf.gemspec",
|
36
|
+
"test/helper.rb",
|
37
|
+
"test/perf_test_example.rb",
|
38
|
+
"test/rubyperf_test_helpers.rb",
|
39
|
+
"test/test_perf_meter.rb"
|
40
|
+
]
|
41
|
+
s.homepage = %q{http://github.com/lpasqualis/rubyperf}
|
42
|
+
s.licenses = ["MIT"]
|
43
|
+
s.require_paths = ["lib"]
|
44
|
+
s.rubygems_version = %q{1.4.2}
|
45
|
+
s.summary = %q{A gem to measure ruby code performance}
|
46
|
+
|
47
|
+
if s.respond_to? :specification_version then
|
48
|
+
s.specification_version = 3
|
49
|
+
|
50
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
51
|
+
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
52
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
53
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
54
|
+
s.add_development_dependency(%q<rcov>, [">= 0"])
|
55
|
+
else
|
56
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
57
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
58
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
59
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
60
|
+
end
|
61
|
+
else
|
62
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
63
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
64
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
65
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
data/test/test_perf_meter.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubyperf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
+
- 1
|
8
9
|
- 0
|
9
|
-
|
10
|
-
version: 0.0.0
|
10
|
+
version: 0.1.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- lpasqualis
|
@@ -89,11 +89,6 @@ extra_rdoc_files:
|
|
89
89
|
- README.rdoc
|
90
90
|
files:
|
91
91
|
- .document
|
92
|
-
- .idea/encodings.xml
|
93
|
-
- .idea/misc.xml
|
94
|
-
- .idea/modules.xml
|
95
|
-
- .idea/rubyperf.iml
|
96
|
-
- .idea/vcs.xml
|
97
92
|
- Gemfile
|
98
93
|
- Gemfile.lock
|
99
94
|
- LICENSE.txt
|
@@ -108,6 +103,7 @@ files:
|
|
108
103
|
- lib/perf/report_format_html.rb
|
109
104
|
- lib/perf/report_format_simple.rb
|
110
105
|
- lib/rubyperf.rb
|
106
|
+
- rubyperf.gemspec
|
111
107
|
- test/helper.rb
|
112
108
|
- test/perf_test_example.rb
|
113
109
|
- test/rubyperf_test_helpers.rb
|
data/.idea/encodings.xml
DELETED
data/.idea/misc.xml
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<project version="4">
|
3
|
-
<component name="DependencyValidationManager">
|
4
|
-
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
|
5
|
-
</component>
|
6
|
-
<component name="ProjectResources">
|
7
|
-
<default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>
|
8
|
-
</component>
|
9
|
-
<component name="ProjectRootManager" version="2" project-jdk-name="ruby-1.8.7-p174" project-jdk-type="RUBY_SDK" />
|
10
|
-
</project>
|
11
|
-
|
data/.idea/modules.xml
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<project version="4">
|
3
|
-
<component name="ProjectModuleManager">
|
4
|
-
<modules>
|
5
|
-
<module fileurl="file://$PROJECT_DIR$/.idea/rubyperf.iml" filepath="$PROJECT_DIR$/.idea/rubyperf.iml" />
|
6
|
-
</modules>
|
7
|
-
</component>
|
8
|
-
</project>
|
9
|
-
|
data/.idea/rubyperf.iml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<module type="RUBY_MODULE" version="4">
|
3
|
-
<component name="NewModuleRootManager">
|
4
|
-
<content url="file://$MODULE_DIR$" />
|
5
|
-
<orderEntry type="inheritedJdk" />
|
6
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
7
|
-
<orderEntry type="library" scope="PROVIDED" name="rcov (v0.9.11, ruby-1.8.7-p174) [gem]" level="application" />
|
8
|
-
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.0.10, ruby-1.8.7-p174) [gem]" level="application" />
|
9
|
-
<orderEntry type="library" scope="PROVIDED" name="rake (v0.9.2.2, ruby-1.8.7-p174) [gem]" level="application" />
|
10
|
-
<orderEntry type="library" scope="PROVIDED" name="shoulda (v2.11.3, ruby-1.8.7-p174) [gem]" level="application" />
|
11
|
-
<orderEntry type="library" scope="PROVIDED" name="jeweler (v1.6.4, ruby-1.8.7-p174) [gem]" level="application" />
|
12
|
-
<orderEntry type="library" scope="PROVIDED" name="git (v1.2.5, ruby-1.8.7-p174) [gem]" level="application" />
|
13
|
-
</component>
|
14
|
-
</module>
|
15
|
-
|