method_profiler 1.2.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +0 -3
- data/lib/method_profiler/profiler.rb +6 -7
- data/lib/method_profiler/report.rb +14 -14
- data/method_profiler.gemspec +1 -1
- metadata +1 -2
- data/lib/method_profiler/core_ext/object.rb +0 -9
data/.travis.yml
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'method_profiler/report'
|
2
|
-
require 'method_profiler/core_ext/object'
|
3
2
|
|
4
3
|
require 'benchmark'
|
5
4
|
|
@@ -89,12 +88,12 @@ module MethodProfiler
|
|
89
88
|
total_time = records.reduce(:+)
|
90
89
|
average = total_time / total_calls
|
91
90
|
results << {
|
92
|
-
:
|
93
|
-
:
|
94
|
-
:
|
95
|
-
:
|
96
|
-
:
|
97
|
-
:
|
91
|
+
method: method,
|
92
|
+
min: records.min,
|
93
|
+
max: records.max,
|
94
|
+
average: average,
|
95
|
+
total_time: total_time,
|
96
|
+
total_calls: total_calls,
|
98
97
|
}
|
99
98
|
end
|
100
99
|
|
@@ -7,12 +7,12 @@ module MethodProfiler
|
|
7
7
|
class Report
|
8
8
|
# Report headers
|
9
9
|
HEADERS = {
|
10
|
-
:
|
11
|
-
:
|
12
|
-
:
|
13
|
-
:
|
14
|
-
:
|
15
|
-
:
|
10
|
+
method: "Method",
|
11
|
+
min: "Min Time",
|
12
|
+
max: "Max Time",
|
13
|
+
average: "Average Time",
|
14
|
+
total_time: "Total Time",
|
15
|
+
total_calls: "Total Calls",
|
16
16
|
}
|
17
17
|
|
18
18
|
# Fields that can be passed to {#sort_by}.
|
@@ -78,15 +78,15 @@ module MethodProfiler
|
|
78
78
|
"MethodProfiler results for: #{@obj}",
|
79
79
|
Hirb::Helpers::Table.render(
|
80
80
|
to_a,
|
81
|
-
:
|
82
|
-
:
|
83
|
-
:
|
84
|
-
:
|
85
|
-
:
|
86
|
-
:
|
87
|
-
:
|
81
|
+
headers: HEADERS.dup,
|
82
|
+
fields: FIELDS.dup,
|
83
|
+
filters: {
|
84
|
+
min: :to_milliseconds,
|
85
|
+
max: :to_milliseconds,
|
86
|
+
average: :to_milliseconds,
|
87
|
+
total_time: :to_milliseconds,
|
88
88
|
},
|
89
|
-
:
|
89
|
+
description: false
|
90
90
|
)
|
91
91
|
].join("\n")
|
92
92
|
end
|
data/method_profiler.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: method_profiler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -75,7 +75,6 @@ files:
|
|
75
75
|
- README.md
|
76
76
|
- Rakefile
|
77
77
|
- lib/method_profiler.rb
|
78
|
-
- lib/method_profiler/core_ext/object.rb
|
79
78
|
- lib/method_profiler/hirb.rb
|
80
79
|
- lib/method_profiler/profiler.rb
|
81
80
|
- lib/method_profiler/report.rb
|