process-metrics 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/command-line.png +0 -0
- data/lib/process/metrics/command/summary.rb +2 -2
- data/lib/process/metrics/general.rb +4 -4
- data/lib/process/metrics/version.rb +1 -1
- data/process-metrics.gemspec +1 -0
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0917ad55068d053da8e6f58943114ab1cc7d2dd7b61969f022c7a373a7212d9
|
4
|
+
data.tar.gz: cff5b81fdad7a03e4c2a843178e5c880c20c68580ef2dd93e9a29b529591ea87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94617d513a1849da4c48d052e4aa92d7279d07deb0f0710439a19f5c87b17a3c9fd259ea260b9c774130c7a111ed7ff4d4870d58ece51c1d2bff6a5c65ccd939
|
7
|
+
data.tar.gz: 2689b081c6aa85ce0901c97feec76ddb54ef9bd322872f1fc6a76a6bfd14f682a8a80499e094fae8c080f443f36ddfaea61ea90c888a63fdee6f027a0fd5a8ed
|
data/README.md
CHANGED
@@ -14,6 +14,12 @@ To add it to your current project:
|
|
14
14
|
|
15
15
|
Memory is measured in kilobytes and time is measured in seconds.
|
16
16
|
|
17
|
+
### Command Line
|
18
|
+
|
19
|
+
You can use the `process-metrics` command line to print data about a running process and it's children:
|
20
|
+
|
21
|
+
![Command Line Example](command-line.png)
|
22
|
+
|
17
23
|
### Capturing for Specific Process
|
18
24
|
|
19
25
|
You can capture the metrics for a single process:
|
data/command-line.png
ADDED
Binary file
|
@@ -147,12 +147,12 @@ module Process
|
|
147
147
|
format_memory_usage[memory.unique_size]
|
148
148
|
)
|
149
149
|
else
|
150
|
-
memory_usage += general.
|
150
|
+
memory_usage += general.rss
|
151
151
|
proportional = false
|
152
152
|
|
153
153
|
terminal.print_line(
|
154
154
|
:key, "Memory (RSS): ".rjust(20), :reset,
|
155
|
-
format_memory_usage[general.
|
155
|
+
format_memory_usage[general.rss]
|
156
156
|
)
|
157
157
|
end
|
158
158
|
end
|
@@ -49,12 +49,12 @@ module Process
|
|
49
49
|
pcpu: ->(value){value.to_f},
|
50
50
|
time: self.method(:duration),
|
51
51
|
vsz: ->(value){value.to_i},
|
52
|
-
|
52
|
+
rss: ->(value){value.to_i},
|
53
53
|
etime: self.method(:duration),
|
54
54
|
command: ->(value){value},
|
55
55
|
}
|
56
56
|
|
57
|
-
class General < Struct.new(:pid, :ppid, :pgid, :pcpu, :vsz, :
|
57
|
+
class General < Struct.new(:pid, :ppid, :pgid, :pcpu, :vsz, :rss, :time, :etime, :command, :memory)
|
58
58
|
def as_json
|
59
59
|
{
|
60
60
|
pid: self.pid,
|
@@ -62,7 +62,7 @@ module Process
|
|
62
62
|
pgid: self.pgid,
|
63
63
|
pcpu: self.pcpu,
|
64
64
|
vsz: self.vsz,
|
65
|
-
|
65
|
+
rss: self.rss,
|
66
66
|
time: self.time,
|
67
67
|
etime: self.etime,
|
68
68
|
command: self.command,
|
@@ -78,7 +78,7 @@ module Process
|
|
78
78
|
if self.memory
|
79
79
|
self.memory.proportional_size
|
80
80
|
else
|
81
|
-
self.
|
81
|
+
self.rss
|
82
82
|
end
|
83
83
|
end
|
84
84
|
|
data/process-metrics.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: process-metrics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-02-
|
11
|
+
date: 2020-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: console
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.8'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: samovar
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '2.1'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: covered
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -95,6 +109,7 @@ files:
|
|
95
109
|
- README.md
|
96
110
|
- Rakefile
|
97
111
|
- bin/process-metrics
|
112
|
+
- command-line.png
|
98
113
|
- lib/process/metrics.rb
|
99
114
|
- lib/process/metrics/command.rb
|
100
115
|
- lib/process/metrics/command/summary.rb
|