test-prof 1.3.2 → 1.3.3
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/CHANGELOG.md +4 -0
- data/lib/test_prof/before_all.rb +1 -1
- data/lib/test_prof/memory_prof/printer.rb +2 -0
- data/lib/test_prof/memory_prof/rspec.rb +7 -4
- data/lib/test_prof/memory_prof/tracker/linked_list.rb +8 -6
- data/lib/test_prof/memory_prof/tracker.rb +14 -10
- data/lib/test_prof/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a719a17544a705f447aeefc448f75bb2ffc11c268661735c11095b593e0d9417
|
4
|
+
data.tar.gz: 3d461a0c4573a0a7c43a7db57b8ecce96baf2c1a60998f56019c437a20ad1f60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0549376752f1b0e6d718333f2e378c2d0cd3bee94a18f52440c0110710f9ab9bc1a23aaaadcd84e1cbf1171402d11cd4eaa98718bbc736cfdcc3f50740cc7e89'
|
7
|
+
data.tar.gz: 3f6546e3d091b6c0aba067d94c12bfd1bf8542d0725b851f06cac81b8507685de4ef7ca25bd38b2bec9b2a98f21c99cfddd68997dca90ab739bbc3f19820fef6
|
data/CHANGELOG.md
CHANGED
data/lib/test_prof/before_all.rb
CHANGED
@@ -16,23 +16,26 @@ module TestProf
|
|
16
16
|
@tracker = MemoryProf.tracker
|
17
17
|
@printer = MemoryProf.printer(tracker)
|
18
18
|
|
19
|
+
@current_group = nil
|
20
|
+
@current_example = nil
|
21
|
+
|
19
22
|
@tracker.start
|
20
23
|
end
|
21
24
|
|
22
25
|
def example_started(notification)
|
23
|
-
tracker.example_started(example(notification))
|
26
|
+
tracker.example_started(notification.example, example(notification))
|
24
27
|
end
|
25
28
|
|
26
29
|
def example_finished(notification)
|
27
|
-
tracker.example_finished(example
|
30
|
+
tracker.example_finished(notification.example)
|
28
31
|
end
|
29
32
|
|
30
33
|
def example_group_started(notification)
|
31
|
-
tracker.group_started(group(notification))
|
34
|
+
tracker.group_started(notification.group, group(notification))
|
32
35
|
end
|
33
36
|
|
34
37
|
def example_group_finished(notification)
|
35
|
-
tracker.group_finished(group
|
38
|
+
tracker.group_finished(notification.group)
|
36
39
|
end
|
37
40
|
|
38
41
|
def report
|
@@ -52,19 +52,20 @@ module TestProf
|
|
52
52
|
attr_reader :head
|
53
53
|
|
54
54
|
def initialize(memory_at_start)
|
55
|
-
add_node(:total, memory_at_start)
|
55
|
+
add_node(:total, :total, memory_at_start)
|
56
56
|
end
|
57
57
|
|
58
|
-
def add_node(item, memory_at_start)
|
58
|
+
def add_node(id, item, memory_at_start)
|
59
59
|
@head = LinkedListNode.new(
|
60
|
+
id: id,
|
60
61
|
item: item,
|
61
62
|
previous: head,
|
62
63
|
memory_at_start: memory_at_start
|
63
64
|
)
|
64
65
|
end
|
65
66
|
|
66
|
-
def remove_node(
|
67
|
-
return if head.
|
67
|
+
def remove_node(id, memory_at_finish)
|
68
|
+
return if head.id != id
|
68
69
|
head.finish(memory_at_finish)
|
69
70
|
|
70
71
|
current = head
|
@@ -75,9 +76,10 @@ module TestProf
|
|
75
76
|
end
|
76
77
|
|
77
78
|
class LinkedListNode
|
78
|
-
attr_reader :item, :previous, :memory_at_start, :memory_at_finish, :nested_memory
|
79
|
+
attr_reader :id, :item, :previous, :memory_at_start, :memory_at_finish, :nested_memory
|
79
80
|
|
80
|
-
def initialize(item:, memory_at_start:, previous:)
|
81
|
+
def initialize(id:, item:, memory_at_start:, previous:)
|
82
|
+
@id = id
|
81
83
|
@item = item
|
82
84
|
@previous = previous
|
83
85
|
|
@@ -36,22 +36,26 @@ module TestProf
|
|
36
36
|
@total_memory = node.total_memory
|
37
37
|
end
|
38
38
|
|
39
|
-
def example_started(example)
|
40
|
-
list.add_node(example, track)
|
39
|
+
def example_started(id, example = id)
|
40
|
+
list.add_node(id, example, track)
|
41
41
|
end
|
42
42
|
|
43
|
-
def example_finished(
|
44
|
-
node = list.remove_node(
|
45
|
-
|
43
|
+
def example_finished(id)
|
44
|
+
node = list.remove_node(id, track)
|
45
|
+
return unless node
|
46
|
+
|
47
|
+
examples << {**node.item, memory: node.total_memory}
|
46
48
|
end
|
47
49
|
|
48
|
-
def group_started(group)
|
49
|
-
list.add_node(group, track)
|
50
|
+
def group_started(id, group = id)
|
51
|
+
list.add_node(id, group, track)
|
50
52
|
end
|
51
53
|
|
52
|
-
def group_finished(
|
53
|
-
node = list.remove_node(
|
54
|
-
|
54
|
+
def group_finished(id)
|
55
|
+
node = list.remove_node(id, track)
|
56
|
+
return unless node
|
57
|
+
|
58
|
+
groups << {**node.item, memory: node.hooks_memory}
|
55
59
|
end
|
56
60
|
end
|
57
61
|
|
data/lib/test_prof/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test-prof
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Dementyev
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -235,7 +235,7 @@ metadata:
|
|
235
235
|
homepage_uri: https://test-prof.evilmartians.io/
|
236
236
|
source_code_uri: https://github.com/test-prof/test-prof
|
237
237
|
funding_uri: https://github.com/sponsors/test-prof
|
238
|
-
post_install_message:
|
238
|
+
post_install_message:
|
239
239
|
rdoc_options: []
|
240
240
|
require_paths:
|
241
241
|
- lib
|
@@ -250,8 +250,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
250
250
|
- !ruby/object:Gem::Version
|
251
251
|
version: '0'
|
252
252
|
requirements: []
|
253
|
-
rubygems_version: 3.4.
|
254
|
-
signing_key:
|
253
|
+
rubygems_version: 3.4.19
|
254
|
+
signing_key:
|
255
255
|
specification_version: 4
|
256
256
|
summary: Ruby applications tests profiling tools
|
257
257
|
test_files: []
|