src.sensor
index
/var/lib/jenkins/workspace/resmon_sensor_doc/src/sensor.py

Contains class connected with gathering and buffering data

 
Modules
       
datetime
hashlib
platform
psutil
random

 
Classes
       
builtins.object
MetaSensor
MetaSensorModule
Sensor
SensorBuffer
SensorModule

 
class MetaSensor(builtins.object)
    Class which is responsible for composing meta data
 
  Methods defined here:
__init__(self, sensor, nameId)
Initialize self.  See help(type(self)) for accurate signature.
addMetaModule(self, metaModule)
Just add metaModule to aray
generateSessionId(self)
Generate unique hash string
getAvailableFields(self)
Getter for available fields
getData(self)
Returns whole stored data ver
getDate(self)
Getter for date
getDescriptions(self)
Returns description for metadatas
getNameId(self)
Getter for user friendly identifier
getSessionId(self)
Getter for session ID
getSystemInfo(self)
Getter for system info
getSystemVersion(self)
Getter for system version

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class MetaSensorModule(builtins.object)
    Class which stores particular parameter used in metadata
 
  Methods defined here:
__init__(self, tag, description, dataGetter)
Initialize self.  See help(type(self)) for accurate signature.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class Sensor(builtins.object)
    This class is responsible for reading various parameters from system
 
  Methods defined here:
__init__(self)
Initialize self.  See help(type(self)) for accurate signature.
addSensorModule(self, module)
Just adds modules to array
getAllData(self)
Return all data and return it in dictionary
getCpuUsage(self)
Getter for CPU usage in percentage
getDate(self)
Getter for date
getLoggedUsersCount(self)
Getter for amount of logged users
getProcessesCount(self)
Getter for amount of logged users
getRamUsage(self)
Getter for RAM usagre in percenrage
getSessionId(self)
Getter for session ID
getVirtualMemAvailable(self)
Getter for available virtual memory
getVirtualMemTotal(self)
Getter for total virtual memory
prepareModules(self)
Add defined modules.
Could be in constructor but tests involves extra function
setSessionId(self, sessionId)
Setter for session ID

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class SensorBuffer(builtins.object)
    Class responsible for buffering data gathered by sensor
 
  Methods defined here:
__init__(self, sensor)
Constructor takes sensor, which will be used for getting data
clearBuffer(self)
Clears buffer
getBufferSize(self)
Returns buffer size
getData(self)
Returns stored data
performMeasurement(self)
Performs measurement and add data to buffer

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class SensorModule(builtins.object)
    Class which stores particular parameter
 
  Methods defined here:
__init__(self, tag, description, unit, dataGetter, isInMeta)
Initialize self.  See help(type(self)) for accurate signature.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)