ruby_reportable 0.3.0 → 0.3.1
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.
- checksums.yaml +4 -4
- data/lib/ruby_reportable/report.rb +19 -11
- data/lib/ruby_reportable/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ce6c1156d97b85a115a1da80e42bfcc8e42b412
|
4
|
+
data.tar.gz: 7585d34ffae9d66e8b1e929ee2ddb4b635acaf7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f20eab08a891aba3b2239e607639dbe60eb5cb2acbc82099a06d01c35d51c3b132852781d072ba03f2e3a9127557668fa305a4a8926a73aa7a2581c36a7e29f5
|
7
|
+
data.tar.gz: 147774a281b825ce2a0713b1a18bbbdb2e0104aefcd45fa67c1a0af682d78e7f4eb92ccbf8a245807b0cceaaba6faf6209e09fcb372d45642ff20760d5475acb
|
@@ -21,7 +21,15 @@ module RubyReportable
|
|
21
21
|
|
22
22
|
def benchmark(name)
|
23
23
|
benchmarks[name] ||= 0.0
|
24
|
-
|
24
|
+
|
25
|
+
@result = nil
|
26
|
+
|
27
|
+
time = Benchmark.realtime do
|
28
|
+
@result = yield
|
29
|
+
end
|
30
|
+
|
31
|
+
benchmarks[name] += time
|
32
|
+
@result
|
25
33
|
end
|
26
34
|
|
27
35
|
def meta(key, value = nil, &block)
|
@@ -171,28 +179,28 @@ module RubyReportable
|
|
171
179
|
options = {:input => {}}.merge(options)
|
172
180
|
|
173
181
|
# initial sandbox
|
174
|
-
benchmark(:sandbox) do
|
175
|
-
|
182
|
+
sandbox = benchmark(:sandbox) do
|
183
|
+
_source(options)
|
176
184
|
end
|
177
185
|
|
178
186
|
# apply filters to source
|
179
|
-
benchmark(:filters) do
|
180
|
-
|
187
|
+
filtered_sandbox = benchmark(:filters) do
|
188
|
+
_data(sandbox, options)
|
181
189
|
end
|
182
190
|
|
183
191
|
# finalize raw data from source
|
184
|
-
benchmark(:finalize) do
|
185
|
-
|
192
|
+
source_data = benchmark(:finalize) do
|
193
|
+
_finalize(filtered_sandbox, options).source
|
186
194
|
end
|
187
195
|
|
188
196
|
# {:default => [{outputs => values}]
|
189
|
-
benchmark(:output) do
|
190
|
-
|
197
|
+
data = benchmark(:output) do
|
198
|
+
_output(source_data, options)
|
191
199
|
end
|
192
200
|
|
193
201
|
# transform into {group => [outputs => values]}
|
194
|
-
benchmark(:group) do
|
195
|
-
|
202
|
+
grouped = benchmark(:group) do
|
203
|
+
_group(options[:group], data, options)
|
196
204
|
end
|
197
205
|
|
198
206
|
# sort grouped data
|