Example #1
0
    def __init__(self, receiver=None, spawnargs=None, **kwargs):
        """
        Constructor.
        Gathers information about the system this agent is running on.
        """
        Process.__init__(self,
                         receiver=receiver,
                         spawnargs=spawnargs,
                         **kwargs)

        if not isinstance(self.spawn_args, dict):
            self.spawn_args = {}

        if not self.spawn_args.has_key("agent_args") or (
                self.spawn_args.has_key("agent_args")
                and not isinstance(self.spawn_args["agent_args"], dict)):
            self.spawn_args["agent_args"] = {}

        self._opunit_id = self.spawn_args["agent_args"].get(
            "opunit_id",
            str(uuid.uuid4())[:8]
        )  # if one didn't get assigned, make one up to report in to the app controller

        self.metrics = {'cores': self._get_cores()}
        self.sqlstreams = {}
        self._fsm_factory_class = kwargs.pop("fsm_factory", SSFSMFactory)

        # for time metrics
        self._timer = time.time()
Example #2
0
    def __init__(self, receiver=None, spawnargs=None, **kwargs):
        """
        Constructor.
        Gathers information about the system this agent is running on.
        """
        Process.__init__(self, receiver=receiver, spawnargs=spawnargs, **kwargs)

        if not isinstance(self.spawn_args, dict):
            self.spawn_args = {}

        if not self.spawn_args.has_key("agent_args") or (self.spawn_args.has_key("agent_args") and not isinstance(self.spawn_args["agent_args"], dict)):
            self.spawn_args["agent_args"] = {}

        # we now pass in agent_args via a configuration param
        cagentargs = CONF.getValue('agent_args', {})
        self.spawn_args["agent_args"].update(cagentargs)

        self._opunit_id = self.spawn_args["agent_args"].get("opunit_id", str(uuid.uuid4())[:8]) # if one didn't get assigned, make one up to report in to the app controller

        self.metrics = { 'cores' : self._get_cores() }
        self.sqlstreams = {}
        self._fsm_factory_class = kwargs.pop("fsm_factory", SSFSMFactory)

        # for time metrics
        self._timer = time.time()
Example #3
0
    def __init__(self, *args, **kwargs):
        Process.__init__(self, *args, **kwargs)

        self.queue_length = {}
        self.recv_count = {}
Example #4
0
    def __init__(self, *args, **kwargs):
        Process.__init__(self, *args, **kwargs)

        self.queue_length = {}
        self.recv_count = {}