process-metrics 0.2.0 → 0.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7cec50409b679c3cb38ad2951f012f9ec80ebd932af96a27aa8e443724b6f08b
4
- data.tar.gz: e93c274723c0a744b9b27d38f20e7ca7c430b33ad804d55f706d3ceda30b95b8
3
+ metadata.gz: 1dfdad473ae6b2f7680c1c62bf67144c0451014c61e6a4d9c38650d2b51dcc86
4
+ data.tar.gz: 5938c811e5b7cab7d849b9430236bd60712158fe744ee5b494e3d01f0ed49997
5
5
  SHA512:
6
- metadata.gz: c81cee9bea7a96472e8e649f6695fafeff89d6c129c0fbc967f4fecac94a5e52818225992d9cce94e75c43abbed8877c1a5da186f14aae3cc56d085c1651c2f2
7
- data.tar.gz: 72694d4aa9dd22d9b9f3ec82bd66586119c1fc6be7edb278c5263279004b551c0a1d8b7364ab5877d503828d904aab9f58206d72fbec65b5d59ce518e01a36f3
6
+ metadata.gz: 2c607a0f1eb78abe097463ebd46784f2212b60b6bc5590dff646aecac131e5da59eb0e3a5ea082943c66d3fc0cb4425d19abb3596ed0350aec51718ac6fb4244
7
+ data.tar.gz: 420abffc1c85856674376cf95455972e58a18b18591ccc003be3e0d9bad6212d17587d93e10c0ec06691c60c187ba43e80af472c8c74be619f4e06f370780d3d
checksums.yaml.gz.sig ADDED
@@ -0,0 +1,2 @@
1
+ l���Ҫ�+n��VT��*�[��p5�-�Ǭ��췯�������u�,�﫢�o1L̑��lH ��U�i�rE+�56��V���8�4*haM�[��6]���G� 3L.N>�ڌ����|c<�LN�{S����ֻ:(�$� h�vN{���4�� ����KkA�����[wӢ�9�u9JE�m1�t�������v\_Li�`�ШY�;;�Q�8�ѿ[|����C�X�[~dz��?�5t-�S#0��K_�lL����B51V�`9��6�3,� p��w%1�?�-���4<ziY��D u�!"@ /e/J��(����U��[| ��\��V���?QC��D�u�~D�q�(�!�]�������oj"$
2
+ 0T0��y4��z���
@@ -1,22 +1,7 @@
1
- # Copyright, 2020, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
2
+
3
+ # Released under the MIT License.
4
+ # Copyright, 2020-2024, by Samuel Williams.
20
5
 
21
6
  require 'samovar'
22
7
 
@@ -77,7 +62,7 @@ module Process
77
62
  return terminal
78
63
  end
79
64
 
80
- def format_pcpu(value, terminal)
65
+ def format_processor_utilization(value, terminal)
81
66
  if value > 80.0
82
67
  intensity = :high
83
68
  elsif value > 50.0
@@ -124,18 +109,21 @@ module Process
124
109
  summary = Process::Metrics::General.capture(pid: @options[:pid], ppid: @options[:ppid])
125
110
 
126
111
  format_memory_usage = self.method(:format_memory_usage).curry
127
- memory_usage = 0
112
+ shared_memory_usage = 0
113
+ private_memory_usage = 0
114
+
128
115
  proportional = true
129
116
 
130
117
  summary.each do |pid, general|
131
118
  terminal.print_line(:pid, pid, :reset, " ", :command, general[:command])
132
119
 
133
120
  terminal.print(:key, "Processor Usage: ".rjust(20), :reset)
134
- format_pcpu(general.pcpu, terminal)
121
+ format_processor_utilization(general.processor_utilization, terminal)
135
122
  terminal.print_line
136
123
 
137
124
  if memory = general.memory
138
- memory_usage += memory.proportional_size
125
+ shared_memory_usage += memory.proportional_size
126
+ private_memory_usage += memory.unique_size
139
127
 
140
128
  terminal.print_line(
141
129
  :key, "Memory (PSS): ".rjust(20), :reset,
@@ -147,12 +135,12 @@ module Process
147
135
  format_memory_usage[memory.unique_size]
148
136
  )
149
137
  else
150
- memory_usage += general.rsz
138
+ shared_memory_usage += general.rss
151
139
  proportional = false
152
140
 
153
141
  terminal.print_line(
154
142
  :key, "Memory (RSS): ".rjust(20), :reset,
155
- format_memory_usage[general.rsz]
143
+ format_memory_usage[general.rss]
156
144
  )
157
145
  end
158
146
  end
@@ -162,7 +150,12 @@ module Process
162
150
  if proportional
163
151
  terminal.print_line(
164
152
  :key, "Memory (PSS): ".rjust(20), :reset,
165
- format_memory_usage[memory_usage]
153
+ format_memory_usage[shared_memory_usage]
154
+ )
155
+
156
+ terminal.print_line(
157
+ :key, "Memory (USS): ".rjust(20), :reset,
158
+ format_memory_usage[private_memory_usage]
166
159
  )
167
160
  else
168
161
  terminal.print_line(
@@ -170,6 +163,11 @@ module Process
170
163
  format_memory_usage[memory_usage]
171
164
  )
172
165
  end
166
+
167
+ terminal.print_line(
168
+ :key, "Memory (Total): ".rjust(20), :reset,
169
+ format_memory_usage[shared_memory_usage + private_memory_usage]
170
+ )
173
171
  end
174
172
  end
175
173
  end
@@ -1,22 +1,7 @@
1
- # Copyright, 2020, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
2
+
3
+ # Released under the MIT License.
4
+ # Copyright, 2020-2024, by Samuel Williams.
20
5
 
21
6
  require 'samovar'
22
7
 
@@ -1,22 +1,7 @@
1
- # Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
2
+
3
+ # Released under the MIT License.
4
+ # Copyright, 2020-2024, by Samuel Williams.
20
5
 
21
6
  require_relative 'command/top'
22
7
 
@@ -1,32 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright, 2019, by Samuel G. D. Williams. <https://www.codeotaku.com>
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the "Software"), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in
13
- # all copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- # THE SOFTWARE.
3
+ # Released under the MIT License.
4
+ # Copyright, 2019-2024, by Samuel Williams.
22
5
 
23
6
  require_relative 'memory'
24
7
  require 'set'
8
+ require 'json'
25
9
 
26
10
  module Process
27
11
  module Metrics
28
12
  PS = "ps"
29
13
 
14
+ # Parse a duration string into seconds.
30
15
  # According to the linux manual page specifications.
31
16
  def self.duration(value)
32
17
  if /((?<days>\d\d)\-)?((?<hours>\d\d):)?(?<minutes>\d\d):(?<seconds>\d\d)?/ =~ value
@@ -34,54 +19,54 @@ module Process
34
19
  end
35
20
  end
36
21
 
37
- # pid: Process Identifier
38
- # pmem: Percentage Memory used.
39
- # pcpu: Percentage Processor used.
40
- # time: The process time used (executing on CPU).
41
- # vsz: Virtual Size in kilobytes
42
- # rss: Resident Set Size in kilobytes
43
- # etime: The process elapsed time.
44
- # command: The name of the process.
22
+ # The fields that will be extracted from the `ps` command.
45
23
  FIELDS = {
46
- pid: ->(value){value.to_i},
47
- ppid: ->(value){value.to_i},
48
- pgid: ->(value){value.to_i},
49
- pcpu: ->(value){value.to_f},
50
- time: self.method(:duration),
51
- vsz: ->(value){value.to_i},
52
- rsz: ->(value){value.to_i},
53
- etime: self.method(:duration),
54
- command: ->(value){value},
24
+ pid: ->(value){value.to_i}, # Process ID
25
+ ppid: ->(value){value.to_i}, # Parent Process ID
26
+ pgid: ->(value){value.to_i}, # Process Group ID
27
+ pcpu: ->(value){value.to_f}, # Percentage CPU
28
+ time: self.method(:duration), # CPU Time
29
+ vsz: ->(value){value.to_i}, # Virtual Size
30
+ rss: ->(value){value.to_i}, # Resident Size
31
+ etime: self.method(:duration), # Elapsed Time
32
+ command: ->(value){value}, # Command (name of the process)
55
33
  }
56
34
 
57
- class General < Struct.new(:pid, :ppid, :pgid, :pcpu, :vsz, :rsz, :time, :etime, :command, :memory)
35
+ # General process information.
36
+ class General < Struct.new(:process_id, :parent_process_id, :process_group_id, :processor_utilization, :virtual_size, :resident_size, :processor_time, :elapsed_time, :command, :memory)
37
+ # Convert the object to a JSON serializable hash.
58
38
  def as_json
59
39
  {
60
- pid: self.pid,
61
- ppid: self.ppid,
62
- pgid: self.pgid,
63
- pcpu: self.pcpu,
64
- vsz: self.vsz,
65
- rsz: self.rsz,
66
- time: self.time,
67
- etime: self.etime,
40
+ process_id: self.process_id,
41
+ parent_process_id: self.parent_process_id,
42
+ process_group_id: self.process_group_id,
43
+ processor_utilization: self.processor_utilization,
44
+ total_size: self.total_size,
45
+ virtual_size: self.virtual_size,
46
+ resident_size: self.resident_size,
47
+ processor_time: self.processor_time,
48
+ elapsed_time: self.elapsed_time,
68
49
  command: self.command,
69
50
  memory: self.memory&.as_json,
70
51
  }
71
52
  end
72
53
 
54
+ # Convert the object to a JSON string.
73
55
  def to_json(*arguments)
74
56
  as_json.to_json(*arguments)
75
57
  end
76
58
 
77
- def memory_usage
78
- if self.memory
79
- self.memory.proportional_size
59
+ # The general memory usage of the process using the best available information.
60
+ def total_size
61
+ if memory = self.memory
62
+ memory.proportional_size
80
63
  else
81
- self.rsz
64
+ self.resident_size
82
65
  end
83
66
  end
84
67
 
68
+ alias memory_usage total_size
69
+
85
70
  def self.expand_children(children, hierarchy, pids)
86
71
  children.each do |pid|
87
72
  self.expand(pid, hierarchy, pids)
@@ -102,8 +87,8 @@ module Process
102
87
  hierarchy = Hash.new{|h,k| h[k] = []}
103
88
 
104
89
  processes.each_value do |process|
105
- if ppid = process.ppid
106
- hierarchy[ppid] << process.pid
90
+ if parent_process_id = process.parent_process_id
91
+ hierarchy[parent_process_id] << process.process_id
107
92
  end
108
93
  end
109
94
 
@@ -116,7 +101,11 @@ module Process
116
101
  end
117
102
  end
118
103
 
119
- def self.capture(pid: nil, ppid: nil, ps: PS, fields: FIELDS)
104
+ # Capture process information. If given a `pid`, it will capture the details of that process. If given a `ppid`, it will capture the details of all child processes. Specify both `pid` and `ppid` if you want to capture a process and all its children.
105
+ #
106
+ # @parameter pid [Integer] The process ID to capture.
107
+ # @parameter ppid [Integer] The parent process ID to capture.
108
+ def self.capture(pid: nil, ppid: nil, ps: PS)
120
109
  input, output = IO.pipe
121
110
 
122
111
  arguments = [ps]
@@ -127,7 +116,7 @@ module Process
127
116
  arguments.push("ax")
128
117
  end
129
118
 
130
- arguments.push("-o", fields.keys.join(','))
119
+ arguments.push("-o", FIELDS.keys.join(','))
131
120
 
132
121
  ps_pid = Process.spawn(*arguments, out: output, pgroup: true)
133
122
 
@@ -138,13 +127,13 @@ module Process
138
127
  processes = {}
139
128
 
140
129
  lines.map do |line|
141
- record = fields.
142
- zip(line.split(/\s+/, fields.size)).
130
+ record = FIELDS.
131
+ zip(line.split(/\s+/, FIELDS.size)).
143
132
  map{|(key, type), value| type.call(value)}
144
133
 
145
134
  instance = self.new(*record)
146
135
 
147
- processes[instance.pid] = instance
136
+ processes[instance.process_id] = instance
148
137
  end
149
138
 
150
139
  if ppid
@@ -1,87 +1,108 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright, 2019, by Samuel G. D. Williams. <https://www.codeotaku.com>
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the "Software"), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in
13
- # all copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- # THE SOFTWARE.
3
+ # Released under the MIT License.
4
+ # Copyright, 2019-2024, by Samuel Williams.
5
+
6
+ require 'json'
22
7
 
23
8
  module Process
24
9
  module Metrics
25
- class Memory < Struct.new(:map_count, :total_size, :resident_size, :proportional_size, :shared_clean_size, :shared_dirty_size, :private_clean_size, :private_dirty_size, :referenced_size, :anonymous_size, :swap_size, :proportional_swap_size)
10
+ class Memory < Struct.new(:map_count, :resident_size, :proportional_size, :shared_clean_size, :shared_dirty_size, :private_clean_size, :private_dirty_size, :referenced_size, :anonymous_size, :swap_size, :proportional_swap_size)
26
11
 
27
12
  alias as_json to_h
28
13
 
14
+ # Convert the object to a JSON string.
29
15
  def to_json(*arguments)
30
16
  as_json.to_json(*arguments)
31
17
  end
32
18
 
19
+ # The total size of the process in memory.
20
+ def total_size
21
+ self.resident_size + self.swap_size
22
+ end
23
+
33
24
  # The unique set size, the size of completely private (unshared) data.
34
25
  def unique_size
35
26
  self.private_clean_size + self.private_dirty_size
36
27
  end
37
28
 
38
- if File.readable?('/proc/self/smaps')
29
+ # The fields that will be extracted from the `smaps` data.
30
+ MAP = {
31
+ "Rss" => :resident_size,
32
+ "Pss" => :proportional_size,
33
+ "Shared_Clean" => :shared_clean_size,
34
+ "Shared_Dirty" => :shared_dirty_size,
35
+ "Private_Clean" => :private_clean_size,
36
+ "Private_Dirty" => :private_dirty_size,
37
+ "Referenced" => :referenced_size,
38
+ "Anonymous" => :anonymous_size,
39
+ "Swap" => :swap_size,
40
+ "SwapPss" => :proportional_swap_size,
41
+ }
42
+
43
+ if File.readable?('/proc/self/smaps_rollup')
44
+ # Whether the memory usage can be captured on this system.
39
45
  def self.supported?
40
46
  true
41
47
  end
42
48
 
43
- MAP = {
44
- "Size" => :total_size,
45
- "Rss" => :resident_size,
46
- "Pss" => :proportional_size,
47
- "Shared_Clean" => :shared_clean_size,
48
- "Shared_Dirty" => :shared_dirty_size,
49
- "Private_Clean" => :private_clean_size,
50
- "Private_Dirty" => :private_dirty_size,
51
- "Referenced" => :referenced_size,
52
- "Anonymous" => :anonymous_size,
53
- "Swap" => :swap_size,
54
- "SwapPss" => :proportional_swap_size,
55
- }
49
+ # Capture memory usage for the given process IDs.
50
+ def self.capture(pids)
51
+ usage = self.new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
52
+
53
+ pids.each do |pid|
54
+ File.foreach("/proc/#{pid}/smaps_rollup") do |line|
55
+ if /(?<name>.*?):\s+(?<value>\d+) kB/ =~ line
56
+ if key = MAP[name]
57
+ usage[key] += value.to_i
58
+ end
59
+ end
60
+ end
61
+
62
+ usage.map_count += File.readlines("/proc/#{pid}/maps").size
63
+ rescue Errno::ENOENT => error
64
+ # Ignore.
65
+ end
66
+
67
+ return usage
68
+ end
69
+ elsif File.readable?('/proc/self/smaps')
70
+ # Whether the memory usage can be captured on this system.
71
+ def self.supported?
72
+ true
73
+ end
56
74
 
75
+ # Capture memory usage for the given process IDs.
57
76
  def self.capture(pids)
58
77
  usage = self.new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
59
78
 
60
79
  pids.each do |pid|
61
- if lines = File.readlines("/proc/#{pid}/smaps")
62
- lines.each do |line|
63
- # The format of this is fixed according to:
64
- # https://github.com/torvalds/linux/blob/351c8a09b00b5c51c8f58b016fffe51f87e2d820/fs/proc/task_mmu.c#L804-L814
65
- if /(?<name>.*?):\s+(?<value>\d+) kB/ =~ line
66
- if key = MAP[name]
67
- usage[key] += value.to_i
68
- end
69
- elsif /VmFlags:\s+(?<flags>.*)/ =~ line
70
- # It should be possible to extract the number of fibers and each fiber's memory usage.
71
- # flags = flags.split(/\s+/)
72
- usage.map_count += 1
80
+ File.foreach("/proc/#{pid}/smaps") do |line|
81
+ # The format of this is fixed according to:
82
+ # https://github.com/torvalds/linux/blob/351c8a09b00b5c51c8f58b016fffe51f87e2d820/fs/proc/task_mmu.c#L804-L814
83
+ if /(?<name>.*?):\s+(?<value>\d+) kB/ =~ line
84
+ if key = MAP[name]
85
+ usage[key] += value.to_i
73
86
  end
87
+ elsif /VmFlags:\s+(?<flags>.*)/ =~ line
88
+ # It should be possible to extract the number of fibers and each fiber's memory usage.
89
+ # flags = flags.split(/\s+/)
90
+ usage.map_count += 1
74
91
  end
75
92
  end
93
+ rescue Errno::ENOENT => error
94
+ # Ignore.
76
95
  end
77
96
 
78
97
  return usage
79
98
  end
80
99
  else
100
+ # Whether the memory usage can be captured on this system.
81
101
  def self.supported?
82
102
  false
83
103
  end
84
104
 
105
+ # Capture memory usage for the given process IDs.
85
106
  def self.capture(pids)
86
107
  return self.new
87
108
  end
@@ -1,27 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright, 2019, by Samuel G. D. Williams. <https://www.codeotaku.com>
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the "Software"), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in
13
- # all copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- # THE SOFTWARE.
3
+ # Released under the MIT License.
4
+ # Copyright, 2019-2024, by Samuel Williams.
22
5
 
23
6
  module Process
24
7
  module Metrics
25
- VERSION = "0.2.0"
8
+ VERSION = "0.3.0"
26
9
  end
27
10
  end
@@ -1,22 +1,7 @@
1
- # Copyright, 2019, by Samuel G. D. Williams. <https://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
2
+
3
+ # Released under the MIT License.
4
+ # Copyright, 2019-2024, by Samuel Williams.
20
5
 
21
6
  require_relative "metrics/version"
22
7
  require_relative "metrics/general"
data/license.md ADDED
@@ -0,0 +1,22 @@
1
+ # MIT License
2
+
3
+ Copyright, 2019-2024, by Samuel Williams.
4
+ Copyright, 2024, by Adam Daniels.
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
data/readme.md ADDED
@@ -0,0 +1,31 @@
1
+ # Process::Metrics
2
+
3
+ Extract performance and memory metrics from running processes.
4
+
5
+ ![Command Line Example](command-line.png)
6
+
7
+ [![Development Status](https://github.com/socketry/process-metrics/workflows/Test/badge.svg)](https://github.com/socketry/process-metrics/actions?workflow=Test)
8
+
9
+ ## Usage
10
+
11
+ Please see the [project documentation](https://socketry.github.io/process-metrics/) for more details.
12
+
13
+ - [Getting Started](https://socketry.github.io/process-metrics/guides/getting-started/index) - This guide explains how to use the `process-metrics` gem to collect and analyze process metrics including processor and memory utilization.
14
+
15
+ ## Contributing
16
+
17
+ We welcome contributions to this project.
18
+
19
+ 1. Fork it.
20
+ 2. Create your feature branch (`git checkout -b my-new-feature`).
21
+ 3. Commit your changes (`git commit -am 'Add some feature'`).
22
+ 4. Push to the branch (`git push origin my-new-feature`).
23
+ 5. Create new Pull Request.
24
+
25
+ ### Developer Certificate of Origin
26
+
27
+ This project uses the [Developer Certificate of Origin](https://developercertificate.org/). All contributors to this project must agree to this document to have their contributions accepted.
28
+
29
+ ### Contributor Covenant
30
+
31
+ This project is governed by the [Contributor Covenant](https://www.contributor-covenant.org/). All contributors and participants agree to abide by its terms.
data.tar.gz.sig ADDED
Binary file
metadata CHANGED
@@ -1,14 +1,44 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: process-metrics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
- autorequire:
8
+ - Adam Daniels
9
+ autorequire:
9
10
  bindir: bin
10
- cert_chain: []
11
- date: 2020-02-01 00:00:00.000000000 Z
11
+ cert_chain:
12
+ - |
13
+ -----BEGIN CERTIFICATE-----
14
+ MIIE2DCCA0CgAwIBAgIBATANBgkqhkiG9w0BAQsFADBhMRgwFgYDVQQDDA9zYW11
15
+ ZWwud2lsbGlhbXMxHTAbBgoJkiaJk/IsZAEZFg1vcmlvbnRyYW5zZmVyMRIwEAYK
16
+ CZImiZPyLGQBGRYCY28xEjAQBgoJkiaJk/IsZAEZFgJuejAeFw0yMjA4MDYwNDUz
17
+ MjRaFw0zMjA4MDMwNDUzMjRaMGExGDAWBgNVBAMMD3NhbXVlbC53aWxsaWFtczEd
18
+ MBsGCgmSJomT8ixkARkWDW9yaW9udHJhbnNmZXIxEjAQBgoJkiaJk/IsZAEZFgJj
19
+ bzESMBAGCgmSJomT8ixkARkWAm56MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIB
20
+ igKCAYEAomvSopQXQ24+9DBB6I6jxRI2auu3VVb4nOjmmHq7XWM4u3HL+pni63X2
21
+ 9qZdoq9xt7H+RPbwL28LDpDNflYQXoOhoVhQ37Pjn9YDjl8/4/9xa9+NUpl9XDIW
22
+ sGkaOY0eqsQm1pEWkHJr3zn/fxoKPZPfaJOglovdxf7dgsHz67Xgd/ka+Wo1YqoE
23
+ e5AUKRwUuvaUaumAKgPH+4E4oiLXI4T1Ff5Q7xxv6yXvHuYtlMHhYfgNn8iiW8WN
24
+ XibYXPNP7NtieSQqwR/xM6IRSoyXKuS+ZNGDPUUGk8RoiV/xvVN4LrVm9upSc0ss
25
+ RZ6qwOQmXCo/lLcDUxJAgG95cPw//sI00tZan75VgsGzSWAOdjQpFM0l4dxvKwHn
26
+ tUeT3ZsAgt0JnGqNm2Bkz81kG4A2hSyFZTFA8vZGhp+hz+8Q573tAR89y9YJBdYM
27
+ zp0FM4zwMNEUwgfRzv1tEVVUEXmoFCyhzonUUw4nE4CFu/sE3ffhjKcXcY//qiSW
28
+ xm4erY3XAgMBAAGjgZowgZcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0O
29
+ BBYEFO9t7XWuFf2SKLmuijgqR4sGDlRsMC4GA1UdEQQnMCWBI3NhbXVlbC53aWxs
30
+ aWFtc0BvcmlvbnRyYW5zZmVyLmNvLm56MC4GA1UdEgQnMCWBI3NhbXVlbC53aWxs
31
+ aWFtc0BvcmlvbnRyYW5zZmVyLmNvLm56MA0GCSqGSIb3DQEBCwUAA4IBgQB5sxkE
32
+ cBsSYwK6fYpM+hA5B5yZY2+L0Z+27jF1pWGgbhPH8/FjjBLVn+VFok3CDpRqwXCl
33
+ xCO40JEkKdznNy2avOMra6PFiQyOE74kCtv7P+Fdc+FhgqI5lMon6tt9rNeXmnW/
34
+ c1NaMRdxy999hmRGzUSFjozcCwxpy/LwabxtdXwXgSay4mQ32EDjqR1TixS1+smp
35
+ 8C/NCWgpIfzpHGJsjvmH2wAfKtTTqB9CVKLCWEnCHyCaRVuKkrKjqhYCdmMBqCws
36
+ JkxfQWC+jBVeG9ZtPhQgZpfhvh+6hMhraUYRQ6XGyvBqEUe+yo6DKIT3MtGE2+CP
37
+ eX9i9ZWBydWb8/rvmwmX2kkcBbX0hZS1rcR593hGc61JR6lvkGYQ2MYskBveyaxt
38
+ Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
39
+ voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
40
+ -----END CERTIFICATE-----
41
+ date: 2024-04-06 00:00:00.000000000 Z
12
42
  dependencies:
13
43
  - !ruby/object:Gem::Dependency
14
44
  name: console
@@ -25,75 +55,40 @@ dependencies:
25
55
  - !ruby/object:Gem::Version
26
56
  version: '1.8'
27
57
  - !ruby/object:Gem::Dependency
28
- name: covered
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: bundler
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: rake
58
+ name: samovar
57
59
  requirement: !ruby/object:Gem::Requirement
58
60
  requirements:
59
61
  - - "~>"
60
62
  - !ruby/object:Gem::Version
61
- version: '12.0'
62
- type: :development
63
+ version: '2.1'
64
+ type: :runtime
63
65
  prerelease: false
64
66
  version_requirements: !ruby/object:Gem::Requirement
65
67
  requirements:
66
68
  - - "~>"
67
69
  - !ruby/object:Gem::Version
68
- version: '12.0'
70
+ version: '2.1'
69
71
  - !ruby/object:Gem::Dependency
70
- name: rspec
72
+ name: json
71
73
  requirement: !ruby/object:Gem::Requirement
72
74
  requirements:
73
75
  - - "~>"
74
76
  - !ruby/object:Gem::Version
75
- version: '3.8'
76
- type: :development
77
+ version: '2'
78
+ type: :runtime
77
79
  prerelease: false
78
80
  version_requirements: !ruby/object:Gem::Requirement
79
81
  requirements:
80
82
  - - "~>"
81
83
  - !ruby/object:Gem::Version
82
- version: '3.8'
83
- description:
84
+ version: '2'
85
+ description:
84
86
  email:
85
- - samuel.williams@oriontransfer.co.nz
86
87
  executables:
87
88
  - process-metrics
88
89
  extensions: []
89
90
  extra_rdoc_files: []
90
91
  files:
91
- - ".gitignore"
92
- - ".rspec"
93
- - ".travis.yml"
94
- - Gemfile
95
- - README.md
96
- - Rakefile
97
92
  - bin/process-metrics
98
93
  - lib/process/metrics.rb
99
94
  - lib/process/metrics/command.rb
@@ -102,13 +97,16 @@ files:
102
97
  - lib/process/metrics/general.rb
103
98
  - lib/process/metrics/memory.rb
104
99
  - lib/process/metrics/version.rb
105
- - process-metrics.gemspec
100
+ - license.md
101
+ - readme.md
106
102
  homepage: https://github.com/socketry/process-metrics
107
103
  licenses:
108
104
  - MIT
109
105
  metadata:
106
+ documentation_uri: https://socketry.github.io/process-metrics/
110
107
  funding_uri: https://github.com/sponsors/ioquatix
111
- post_install_message:
108
+ source_code_uri: https://github.com/socketry/process-metrics.git
109
+ post_install_message:
112
110
  rdoc_options: []
113
111
  require_paths:
114
112
  - lib
@@ -116,15 +114,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
116
114
  requirements:
117
115
  - - ">="
118
116
  - !ruby/object:Gem::Version
119
- version: 2.3.0
117
+ version: '0'
120
118
  required_rubygems_version: !ruby/object:Gem::Requirement
121
119
  requirements:
122
120
  - - ">="
123
121
  - !ruby/object:Gem::Version
124
122
  version: '0'
125
123
  requirements: []
126
- rubygems_version: 3.1.2
127
- signing_key:
124
+ rubygems_version: 3.5.3
125
+ signing_key:
128
126
  specification_version: 4
129
127
  summary: Provide detailed OS-specific process metrics.
130
128
  test_files: []
metadata.gz.sig ADDED
@@ -0,0 +1,3 @@
1
+ h�n1��aZ��e0w�v��Ѷ����)A�QjlX#���5�Q��_F���|��b�ӎt�Q�&깆r���f�y-���cy�F�/J3��F��c��&e�:L�],p,��{o�h��#w$��3����7�1eǒ�����Yo�
2
+ �7A�
3
+ &&�{ _��Wl����J҂�5H��жѨ�v��~\G�Y͇ ���',<�⻺X��Z���S��I��Y|�Ѳ
data/.gitignore DELETED
@@ -1,14 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
-
10
- Gemfile.lock
11
-
12
- # rspec failure tracking
13
- .rspec_status
14
- .covered.db
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --warnings
3
- --require spec_helper
data/.travis.yml DELETED
@@ -1,22 +0,0 @@
1
- language: ruby
2
- dist: xenial
3
- cache: bundler
4
-
5
- matrix:
6
- include:
7
- - rvm: 2.4
8
- - rvm: 2.5
9
- - rvm: 2.6
10
- - rvm: 2.6
11
- env: COVERAGE=PartialSummary,Coveralls
12
- - rvm: 2.7
13
- - rvm: truffleruby
14
- - rvm: jruby-head
15
- - rvm: ruby-head
16
- - rvm: 2.7
17
- os: osx
18
- allow_failures:
19
- - rvm: truffleruby
20
- - rvm: ruby-head
21
- - rvm: jruby-head
22
- - rvm: truffleruby
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- # Specify your gem's dependencies in process-metrics.gemspec
4
- gemspec
data/README.md DELETED
@@ -1,178 +0,0 @@
1
- # Process::Metrics
2
-
3
- Extract performance and memory metrics from running processes.
4
-
5
- [![Build Status](https://travis-ci.com/socketry/process-metrics.svg)](https://travis-ci.com/socketry/process-metrics)
6
-
7
- ## Installation
8
-
9
- To add it to your current project:
10
-
11
- bundle add process-metrics
12
-
13
- ## Usage
14
-
15
- Memory is measured in kilobytes and time is measured in seconds.
16
-
17
- ### Capturing for Specific Process
18
-
19
- You can capture the metrics for a single process:
20
-
21
- ```ruby
22
- #!/usr/bin/env ruby
23
-
24
- require 'process/metrics'
25
-
26
- metrics = Process::Metrics.capture(pid: Process.pid)
27
-
28
- pp metrics
29
- # [{:pid=>282195,
30
- # :ppid=>230572,
31
- # :pgid=>282195,
32
- # :pcpu=>0.0,
33
- # :time=>0,
34
- # :vsz=>78800,
35
- # :rss=>14360,
36
- # :etime=>0,
37
- # :command=>"ruby /tmp/6b35f421-4595-45d6-b444-754a50636daf",
38
- # :memory=>
39
- # {:total=>78804,
40
- # :rss=>14600,
41
- # :pss=>9208,
42
- # :shared_clean=>5728,
43
- # :shared_dirty=>0,
44
- # :private_clean=>16,
45
- # :private_dirty=>8856,
46
- # :referenced=>14600,
47
- # :anonymous=>8856,
48
- # :swap=>0,
49
- # :swap_pss=>0,
50
- # :maps=>150}}]
51
- ```
52
-
53
- ### Capturing for Process Hierarchy
54
-
55
- You can capture the metrics for a process and all it's children:
56
-
57
- ```ruby
58
- #!/usr/bin/env ruby
59
-
60
- require 'process/metrics'
61
-
62
- ppid = ENV["PPID"].to_i
63
- metrics = Process::Metrics.capture(pid: ppid, ppid: ppid)
64
-
65
- pp metrics
66
- # [{:pid=>68536,
67
- # :ppid=>46295,
68
- # :pgid=>68536,
69
- # :pcpu=>0.0,
70
- # :time=>0,
71
- # :vsz=>94516,
72
- # :rss=>29688,
73
- # :etime=>41057,
74
- # :command=>
75
- # "/home/samuel/.rbenv/versions/2.7.0/bin/ruby /home/samuel/.rbenv/versions/2.7.0/bin/falcon-host ./falcon.rb",
76
- # :memory=>
77
- # {:total=>94520,
78
- # :rss=>29696,
79
- # :pss=>8912,
80
- # :shared_clean=>9528,
81
- # :shared_dirty=>14588,
82
- # :private_clean=>924,
83
- # :private_dirty=>4656,
84
- # :referenced=>29696,
85
- # :anonymous=>19244,
86
- # :swap=>0,
87
- # :swap_pss=>0,
88
- # :maps=>294}},
89
- # {:pid=>68558,
90
- # :ppid=>68536,
91
- # :pgid=>68558,
92
- # :pcpu=>0.0,
93
- # :time=>0,
94
- # :vsz=>94516,
95
- # :rss=>23612,
96
- # :etime=>41057,
97
- # :command=>"supervisor",
98
- # :memory=>
99
- # {:total=>94520,
100
- # :rss=>23612,
101
- # :pss=>7551,
102
- # :shared_clean=>4416,
103
- # :shared_dirty=>14448,
104
- # :private_clean=>0,
105
- # :private_dirty=>4748,
106
- # :referenced=>11184,
107
- # :anonymous=>19196,
108
- # :swap=>0,
109
- # :swap_pss=>0,
110
- # :maps=>294}},
111
- # {:pid=>68559,
112
- # :ppid=>68536,
113
- # :pgid=>68558,
114
- # :pcpu=>0.0,
115
- # :time=>0,
116
- # :vsz=>95000,
117
- # :rss=>25136,
118
- # :etime=>41057,
119
- # :command=>"Falcon Host for hello.localhost",
120
- # :memory=>
121
- # {:total=>95004,
122
- # :rss=>25136,
123
- # :pss=>9308,
124
- # :shared_clean=>5504,
125
- # :shared_dirty=>11784,
126
- # :private_clean=>0,
127
- # :private_dirty=>7848,
128
- # :referenced=>17596,
129
- # :anonymous=>19632,
130
- # :swap=>0,
131
- # :swap_pss=>0,
132
- # :maps=>295}},
133
- # ... snip ...
134
- ```
135
-
136
- ### Metrics
137
-
138
- On some platforms (currently only Linux), additional memory metrics are captured.
139
-
140
- #### Proportional Set Size
141
-
142
- The total private memory usage + shared memory usage divided by the number of processes sharing said data.
143
-
144
- #### Unique Set Size
145
-
146
- The total private memory usage.
147
-
148
- ## Contributing
149
-
150
- 1. Fork it
151
- 2. Create your feature branch (`git checkout -b my-new-feature`)
152
- 3. Commit your changes (`git commit -am 'Add some feature'`)
153
- 4. Push to the branch (`git push origin my-new-feature`)
154
- 5. Create new Pull Request
155
-
156
- ## License
157
-
158
- Released under the MIT license.
159
-
160
- Copyright, 2019, by [Samuel G. D. Williams](https://www.codeotaku.com).
161
-
162
- Permission is hereby granted, free of charge, to any person obtaining a copy
163
- of this software and associated documentation files (the "Software"), to deal
164
- in the Software without restriction, including without limitation the rights
165
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
166
- copies of the Software, and to permit persons to whom the Software is
167
- furnished to do so, subject to the following conditions:
168
-
169
- The above copyright notice and this permission notice shall be included in
170
- all copies or substantial portions of the Software.
171
-
172
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
173
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
174
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
175
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
176
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
177
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
178
- THE SOFTWARE.
data/Rakefile DELETED
@@ -1,6 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
-
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task :default => :spec
@@ -1,32 +0,0 @@
1
- require_relative 'lib/process/metrics/version'
2
-
3
- Gem::Specification.new do |spec|
4
- spec.name = "process-metrics"
5
- spec.version = Process::Metrics::VERSION
6
- spec.authors = ["Samuel Williams"]
7
- spec.email = ["samuel.williams@oriontransfer.co.nz"]
8
-
9
- spec.summary = "Provide detailed OS-specific process metrics."
10
- spec.homepage = "https://github.com/socketry/process-metrics"
11
- spec.license = "MIT"
12
-
13
- spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
14
-
15
- spec.metadata["funding_uri"] = "https://github.com/sponsors/ioquatix"
16
-
17
- # Specify which files should be added to the gem when it is released.
18
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
19
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
20
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
21
- end
22
-
23
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
24
- spec.require_paths = ["lib"]
25
-
26
- spec.add_dependency "console", "~> 1.8"
27
-
28
- spec.add_development_dependency "covered"
29
- spec.add_development_dependency "bundler"
30
- spec.add_development_dependency "rake", "~> 12.0"
31
- spec.add_development_dependency "rspec", "~> 3.8"
32
- end