riaps.deplo.netmon module
Resource monitors
Created on Nov 23, 2017
@author: riaps
- class riaps.deplo.netmon.NHAction[source]
Bases:
object- MAP = {1: 'SET', 2: 'REMOVE'}
- REMOVE = 2
- SET = 1
- class riaps.deplo.netmon.NHLoopStatus[source]
Bases:
objectReturn codes from nethogsmonitor_loop()
- FAILURE = 1
- MAP = {0: 'OK', 1: 'FAILURE', 2: 'NO_DEVICE'}
- NO_DEVICE = 2
- OK = 0
- class riaps.deplo.netmon.NHMonitorRecord[source]
Bases:
Structurectypes version of the struct of the same name from libnethogs.h
- device_name
Structure/Union member
- name
Structure/Union member
- pid
Structure/Union member
- record_id
Structure/Union member
- recv_bytes
Structure/Union member
- recv_kbs
Structure/Union member
- sent_bytes
Structure/Union member
- sent_kbs
Structure/Union member
- uid
Structure/Union member
- class riaps.deplo.netmon.NetMonitorThread(parent)[source]
Bases:
Thread- dev_args(devnames)[source]
Return the appropriate ctypes arguments for a device name list, to pass to libnethogs
nethogsmonitor_loop_devices. The return value is a 2-tuple of devc (ctypes.c_int) and devicenames (ctypes.POINTER) to an array ofctypes.c_char).
- run()[source]
Method representing the thread’s activity.
You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.