memory 0.8.3 → 0.8.4
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
- checksums.yaml.gz.sig +0 -0
- data/lib/memory/aggregate.rb +2 -2
- data/lib/memory/usage.rb +7 -0
- data/lib/memory/version.rb +1 -1
- data/readme.md +4 -0
- data/releases.md +4 -0
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +3 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cbe94b9b53feb63ebeef3069e3632f08084467a2670714f9680c881a88a3f133
|
|
4
|
+
data.tar.gz: 95c23b5b6cd0be124e9370b7631118bf24e5fbcc0b19091588d01ff723769d06
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b94371ccdf66d56362320b83370c9b59d7db1d4b75d62c8506fa19392cf9da62b14eaecf8c981f518edf18c10bb65627c55687146c7fe9af0c4faa3a92f86982
|
|
7
|
+
data.tar.gz: 764fc3157811e87be1a6d220425ee5c1c3135c9e47a3ce99066968d82948f8cbdf01dad47538cf22ac25a062c2d5c486bff024fa5ee862686779dade668dc046
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/lib/memory/aggregate.rb
CHANGED
|
@@ -36,7 +36,7 @@ module Memory
|
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
# Sort totals by a given key.
|
|
39
|
-
# @parameter key [Symbol] The key to sort by (e.g., :
|
|
39
|
+
# @parameter key [Symbol] The key to sort by (e.g., :size or :count).
|
|
40
40
|
# @returns [Array] Sorted array of [metric, total] pairs.
|
|
41
41
|
def totals_by(key)
|
|
42
42
|
@totals.sort_by{|metric, total| [total[key], metric]}
|
|
@@ -50,7 +50,7 @@ module Memory
|
|
|
50
50
|
def print(io = $stderr, limit: 10, title: @title, level: 2)
|
|
51
51
|
io.puts "#{'#' * level} #{title} #{@total}", nil
|
|
52
52
|
|
|
53
|
-
totals_by(:
|
|
53
|
+
totals_by(:size).last(limit).reverse_each do |metric, total|
|
|
54
54
|
io.puts "- #{total}\t#{metric}"
|
|
55
55
|
end
|
|
56
56
|
|
data/lib/memory/usage.rb
CHANGED
|
@@ -19,10 +19,17 @@ module Memory
|
|
|
19
19
|
attr_accessor :size
|
|
20
20
|
|
|
21
21
|
alias memsize size
|
|
22
|
+
alias memory size
|
|
22
23
|
|
|
23
24
|
# @attribute count [Integer] The total count of the usage in object instances.
|
|
24
25
|
attr_accessor :count
|
|
25
26
|
|
|
27
|
+
# Access usage attributes by key.
|
|
28
|
+
# @parameter key [Symbol] The attribute name (:size, :count, :memory, :memsize).
|
|
29
|
+
def [](key)
|
|
30
|
+
public_send(key)
|
|
31
|
+
end
|
|
32
|
+
|
|
26
33
|
# Add an allocation to this usage.
|
|
27
34
|
# @parameter allocation [Allocation] The allocation to add.
|
|
28
35
|
def << allocation
|
data/lib/memory/version.rb
CHANGED
data/readme.md
CHANGED
|
@@ -94,6 +94,10 @@ end
|
|
|
94
94
|
|
|
95
95
|
Please see the [project releases](https://socketry.github.io/memory/releases/index) for all releases.
|
|
96
96
|
|
|
97
|
+
### v0.8.4
|
|
98
|
+
|
|
99
|
+
- Fix bugs when printing reports due to interface mismatch with `Memory::Usage`.
|
|
100
|
+
|
|
97
101
|
### v0.8.3
|
|
98
102
|
|
|
99
103
|
- Handle `Memory::Usage.of(number)` without error.
|
data/releases.md
CHANGED
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
�
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
��Fx�Z��t_�\])c�}7�j}O��v�ܺ�����|ӈ��\i������dʺ�N����8K���v��9@rC1 1<p�[?R��:^���m%��E*D?J��xv�=to�����jٖ,\P�냢�$Ņ�
|
|
1
|
+
.ӗ�9ϋ-���(��̏�)�9jq����RaS�OZ�@��T�0�c�H7@�kƢ���=@��EU��PkDJۢ��/㫉V�����7��rkaO
|
|
2
|
+
��Y;r��l���QR��B*ȧ���o��-�j���hW�1F1�/�u�ew�/����c�L�M �;]�I�)^1DF{fr���@¤S2U#�8��(潗�k�4 $
|
|
3
|
+
����zqX���ui�eLYgՕ{�ũwΧ��.f�O����
|