archipelagentvirtualmachineoomkiller :: oomkiller :: TNOOMKiller :: Class TNOOMKiller
[hide private]
[frames] | no frames]

Class TNOOMKiller

source code

archipelcore.archipelPlugin.TNArchipelPlugin --+
                                               |
                                              TNOOMKiller

Instance Methods [hide private]
 
__init__(self, configuration, entity, entry_point_group)
Initialize the plugin.
source code
 
register_handlers(self)
This method will be called by the plugin user when it will be necessary to register module for listening to stanza.
source code
 
unregister_handlers(self)
Unregister the handlers.
source code
 
vm_create(self, origin, user_info, parameters)
Handle create HOOK_VM_CREATE.
source code
 
vm_terminate(self, origin, user_info, parameters)
Handle create HOOK_VM_TERMINATE.
source code
 
vm_initialized(self, origin, user_info, parameters)
Handle create HOOK_VM_INITIALIZE.
source code
dict
get_oom_info(self)
Get the OOM info from file.
source code
 
set_oom_info(self, adjust, score)
Set the OOM info both on file if exists and on file.
source code
 
process_iq(self, conn, iq)
This method is invoked when a ARCHIPEL_NS_OOM_KILLER IQ is received.
source code
xmpp.Protocol.Iq
iq_oom_get_adjust(self, iq)
Return the value of the oom_adjust of the virtual machine.
source code
xmpp.Protocol.Iq
iq_oom_set_adjust(self, iq)
Set the adjust value of oom killer from -16:15 plus special -17 value that disable oom killer for the process the lower the value his the higher the likelihood of killing the process.
source code
Static Methods [hide private]
dict
plugin_info()
Return informations about the plugin.
source code
Method Details [hide private]

__init__(self, configuration, entity, entry_point_group)
(Constructor)

source code 

Initialize the plugin.

Parameters:
  • configuration (Configuration object) - the configuration
  • entity (TNArchipelEntity) - the entity that owns the plugin
  • entry_point_group (string) - the group name of plugin entry_point
Overrides: archipelcore.archipelPlugin.TNArchipelPlugin.__init__

register_handlers(self)

source code 

This method will be called by the plugin user when it will be necessary to register module for listening to stanza.

Overrides: archipelcore.archipelPlugin.TNArchipelPlugin.register_handlers

unregister_handlers(self)

source code 

Unregister the handlers.

Overrides: archipelcore.archipelPlugin.TNArchipelPlugin.unregister_handlers

plugin_info()
Static Method

source code 

Return informations about the plugin.

Returns: dict
dictionary contaning plugin informations
Overrides: archipelcore.archipelPlugin.TNArchipelPlugin.plugin_info

vm_create(self, origin, user_info, parameters)

source code 

Handle create HOOK_VM_CREATE.

Parameters:
  • origin (TNArchipelEntity) - the origin of the hook
  • user_info (object) - random user info
  • parameters (object) - runtim argument

vm_terminate(self, origin, user_info, parameters)

source code 

Handle create HOOK_VM_TERMINATE.

Parameters:
  • origin (TNArchipelEntity) - the origin of the hook
  • user_info (object) - random user info
  • parameters (object) - runtim argument

vm_initialized(self, origin, user_info, parameters)

source code 

Handle create HOOK_VM_INITIALIZE.

Parameters:
  • origin (TNArchipelEntity) - the origin of the hook
  • user_info (object) - random user info
  • parameters (object) - runtim argument

get_oom_info(self)

source code 

Get the OOM info from file.

Returns: dict
dict contaning OOM status

set_oom_info(self, adjust, score)

source code 

Set the OOM info both on file if exists and on file.

Parameters:
  • adjust (int) - the value of adjust
  • score (int) - the value of the score

process_iq(self, conn, iq)

source code 

This method is invoked when a ARCHIPEL_NS_OOM_KILLER IQ is received. It understands IQ of type:

  • do-something
Parameters:
  • conn (xmpp.Dispatcher) - ths instance of the current connection that send the stanza
  • iq (xmpp.Protocol.Iq) - the received IQ

iq_oom_get_adjust(self, iq)

source code 

Return the value of the oom_adjust of the virtual machine.

Parameters:
  • iq (xmpp.Protocol.Iq) - the received IQ
Returns: xmpp.Protocol.Iq
a ready to send IQ containing the result of the action

iq_oom_set_adjust(self, iq)

source code 

Set the adjust value of oom killer from -16:15 plus special -17 value that disable oom killer for the process the lower the value his the higher the likelihood of killing the process.

Parameters:
  • iq (xmpp.Protocol.Iq) - the received IQ
Returns: xmpp.Protocol.Iq
a ready to send IQ containing the result of the action