Package archipelagenthypervisorhealth :: Module archipelStatsCollector :: Class TNThreadedHealthCollector
[hide private]
[frames] | no frames]

Class TNThreadedHealthCollector

source code

        object --+        
                 |        
threading._Verbose --+    
                     |    
      threading.Thread --+
                         |
                        TNThreadedHealthCollector

This class collects hypervisor stats regularly.

Instance Methods [hide private]
 
__init__(self, database_file, collection_interval, max_rows_before_purge, max_cached_rows, exclude_interfaces)
The contructor of the class.
source code
 
recover_stored_stats(self)
Recover info from database.
source code
TNArchipelVirtualMachine
get_collected_stats(self, limit=1)
This method returns the current TNArchipelVirtualMachine instance.
source code
tupple
get_uptime(self)
Get the uptime from /proc/uptime.
source code
dict
get_memory_stats(self)
Get memory stats.
source code
dict
get_cpu_stats(self)
Get CPU stats.
source code
dict
get_load_stats(self)
Get load stats.
source code
dict
get_disk_stats(self)
Get drive usage stats.
source code
dict
get_disk_total(self)
Get total size of drive used stats.
source code
dict
get_network_stats(self)
Get network stats.
source code
 
getTimeList(self)
ignore
source code
 
deltaTime(self, interval)
ignore
source code
 
run(self)
Overrides super class method.
source code

Inherited from threading.Thread: __repr__, daemon, getName, ident, isAlive, isDaemon, is_alive, join, name, setDaemon, setName, start

Inherited from threading.Thread (private): _set_daemon, _set_ident

Inherited from threading._Verbose (private): _note

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, database_file, collection_interval, max_rows_before_purge, max_cached_rows, exclude_interfaces)
(Constructor)

source code 

The contructor of the class.

Parameters:
  • database_file (string) - the path of the database
  • collection_interval (integer) - the intervale between two collection
  • max_rows_before_purge (integer) - max number of rows that can be stored in database
  • max_cached_rows (integer) - max number of rows that are cached into memory
Overrides: object.__init__

get_collected_stats(self, limit=1)

source code 

This method returns the current TNArchipelVirtualMachine instance.

Parameters:
  • limit (integer) - the max number of row to get
Returns: TNArchipelVirtualMachine
the TNArchipelVirtualMachine instance

get_uptime(self)

source code 

Get the uptime from /proc/uptime. code taken from http://thesmithfam.org/blog/2005/11/19/python-uptime-script/

Returns: tupple
days, hours, minutes, seconds

get_memory_stats(self)

source code 

Get memory stats.

Returns: dict
dictionnary containing the informations

get_cpu_stats(self)

source code 

Get CPU stats.

Returns: dict
dictionnary containing the informations

get_load_stats(self)

source code 

Get load stats.

Returns: dict
dictionnary containing the informations

get_disk_stats(self)

source code 

Get drive usage stats.

Returns: dict
dictionnary containing the informations

get_disk_total(self)

source code 

Get total size of drive used stats.

Returns: dict
dictionnary containing the informations

get_network_stats(self)

source code 

Get network stats.

Returns: dict
dictionnary containing the informations

run(self)

source code 

Overrides super class method. do the TNArchipelVirtualMachine main loop.

Overrides: threading.Thread.run