�
�~�e� � �j � d dl Z d dlZd dlmZ d dlmZ d dlmZ d dlmZ d dlm Z G d� d� Z
d � Zy)
� N)�datetime)� timedelta)�sysstats)�detect_jiffies)�to_timestampc �, � e Zd ZdZ dd�Zd� Zd� Zy)�ProcessInformationaI
@param proc_dir: The directory to use for process information.
@param jiffies: The value to use for jiffies per second.
@param boot_time: An alternate value to use for the last boot time. If
None, the system last boot time will be used.
@param uptime: The uptime value to use (for unit tests only).
Nc �� � |�"t j � j � }|�t j |� }|| _ || _ |xs
t � | _ || _ y )N)
r � BootTimes�get_last_boot_timer �utcfromtimestamp�
_boot_time� _proc_dirr �_jiffies_per_sec�_uptime)�self�proc_dir�jiffies� boot_time�uptimes �7/usr/lib/python3/dist-packages/landscape/lib/process.py�__init__zProcessInformation.__init__ s\ � � �� �*�*�,�?�?�A�I�� � �1�1�)�<�I�#���!��� '� ;�>�+;������ c # � K � t j | j � D ]& |