Worker UtilityΒΆ

The Worker Utility class must implement these methods:
  1. start_new_worker - spawns a new worker for a SLA
  2. kill_worker - kills a worker of a specified SLA
  3. workers_for_sla - returns the number of workers operating on a specified SLA

To customize the Worker Utility you must implement a new Class for Tracking, based on

class DefaultWorkerUtility(object):

    @classmethod
    def start_new_worker(cls, sla_id):
        print("Default spawn function")

    @classmethod
    def kill_worker(cls, sla_id):
        print("Default kill function")

    @classmethod
    def workers_for_sla(cls, sla_id):
        return 3

To use it, specify the location in the configuration file at the key: worker_utility_class_path

For example the default configuration

worker_utility_class_path = hostit_monitoring.lib.default_worker_utility:DefaultWorkerUtility

We provided an implementation of the Worker Utility class, called DefaultWorker Utility (hostit_monitoring.lib.default_worker_utility:DefaultWorkerUtility)