You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: context/getting-started.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,7 @@ $ gem install process-metrics
21
21
The `process-metrics` gem provides a simple interface to collect and analyze process metrics.
22
22
23
23
- {ruby Process::Metrics::General} is the main entry point for process metrics. Use {ruby Process::Metrics::General.capture} to collect metrics for one or more processes.
24
+
- {ruby Process::Metrics::Processor} computes CPU utilization over intervals from consecutive process snapshots.
24
25
- {ruby Process::Metrics::Memory} provides additional methods for collecting memory metrics when the host operating system provides the necessary information.
`processor_time` is the CPU time consumed during `duration`. `utilization` is a ratio, where one fully occupied CPU core is approximately `1.0`. A process using multiple cores can exceed `1.0`.
83
+
63
84
### Fields
64
85
65
86
The {ruby Process::Metrics::General} struct contains the following fields:
@@ -72,6 +93,7 @@ The {ruby Process::Metrics::General} struct contains the following fields:
72
93
-`resident_size` - Resident (Set) Size (bytes), the amount of physical memory used by the process.
73
94
-`processor_time` - CPU Time (s), the amount of CPU time used by the process.
74
95
-`elapsed_time` - Elapsed Time (s), the amount of time the process has been running.
96
+
-`start_time` - Start Time, expressed as seconds since the Unix epoch.
75
97
-`command` - Command Name, the name of the command that started the process.
76
98
77
99
The {ruby Process::Metrics::Memory} struct contains the following fields:
# Capture process information from /proc. If given `pid`, captures only those process(es). If given `ppid`, captures that parent and all descendants. Both can be given to capture a process and its children.
0 commit comments