djberg96 / sys-proctable

A cross-platform Ruby interface for gathering process information on your operating system
Apache License 2.0
150 stars 33 forks source link

[darwin] Add .rss and .pss convenience methods #75

Closed NickLaMuro closed 6 years ago

NickLaMuro commented 6 years ago

Built off of https://github.com/djberg96/sys-proctable/pull/74 (required to be merged first)

Generally, when Sys::ProcTable is used for a single process, usually the user is only requesting a single value from all of the data collected. These methods are examples of using the recently refactored .ps method's parts to access a smaller concise amount of data. This helps reduce the number of object allocations when the data needed is minimal.

djberg96 commented 6 years ago

After thinking about this some more, I'm going to reject it. One of my goals is to keep the interface consistent across platforms, and this would violate that. Or I'd have to add it to all the other platforms, which I don't feel like doing.

I did incorporate one bit of cleanup with apply_info_to_struct, so thanks for that.