示例#1
0
    def __init__(self, name, nobjects, query_frac, **kwargs):
        """
        name: Name of the test
        nobjects: Number of objects in simulation
        query_frac: Fraction of objects that register queries
        Others: see ClusterSimTest.__init__
        """
        # pre_sim_func
        if 'pre_sim_func' in kwargs:
            pre_sim_func = kwargs['pre_sim_func']
            del kwargs['pre_sim_func']
        else:
            pre_sim_func = self.__pre_sim_func

        # sim_func
        if 'sim_func' in kwargs:
            sim_func = kwargs['sim_func']
            del kwargs['sim_func']
        else:
            sim_func = self.__sim_func

        # post_sim_func
        if 'post_sim_func' in kwargs:
            post_sim_func = kwargs['post_sim_func']
            del kwargs['post_sim_func']
        else:
            post_sim_func = self.__post_sim_func

        ClusterSimTest.__init__(self, name, pre_sim_func=pre_sim_func, sim_func=sim_func, post_sim_func=post_sim_func, **kwargs)
        self.bench = Pinto(self._cc, self._cs, nobjects=nobjects, query_frac=query_frac)
示例#2
0
    def __init__(self, name, rate, local_pings=True, remote_pings=True, payload=0, **kwargs):
        """
        name: Name of the test
        rate: Ping rate to test with
        local_pings: if True, pings to objects on the same server are generated
        remote_pings: if True, pings to objects on remote servers are generated
        payload: Size of ping payloads
        Others: see ClusterSimTest.__init__
        """
        assert type(rate) != list
        self.rate = rate

        # pre_sim_func
        if 'pre_sim_func' in kwargs:
            pre_sim_func = kwargs['pre_sim_func']
            del kwargs['pre_sim_func']
        else:
            pre_sim_func = self.__pre_sim_func

        # sim_func
        if 'sim_func' in kwargs:
            sim_func = kwargs['sim_func']
            del kwargs['sim_func']
        else:
            sim_func = self.__sim_func

        # post_sim_func
        if 'post_sim_func' in kwargs:
            post_sim_func = kwargs['post_sim_func']
            del kwargs['post_sim_func']
        else:
            post_sim_func = self.__post_sim_func

        ClusterSimTest.__init__(self, name, pre_sim_func=pre_sim_func, sim_func=sim_func, post_sim_func=post_sim_func, **kwargs)
        self.bench = PacketLatencyByLoad(self._cc, self._cs, local_messages=local_pings, remote_messages=remote_pings, payload=payload)
示例#3
0
    def __init__(self, name, rate, scheme, payload, local=False, oh_pool=1, packname='flow.pack', **kwargs):
        """
        name: Name of the test
        rate: Ping rate to test with
        scheme: Fairness scheme to use. ('region', 'csfq')
        payload: Size of ping payloads
        local: Whether only local messages should be generated, False by default
        Others: see ClusterSimTest.__init__
        """
        assert type(rate) != list
        self.rate = rate

        # pre_sim_func
        if 'pre_sim_func' in kwargs:
            pre_sim_func = kwargs['pre_sim_func']
            del kwargs['pre_sim_func']
        else:
            pre_sim_func = self.__pre_sim_func

        # sim_func
        if 'sim_func' in kwargs:
            sim_func = kwargs['sim_func']
            del kwargs['sim_func']
        else:
            sim_func = self.__sim_func

        # post_sim_func
        if 'post_sim_func' in kwargs:
            post_sim_func = kwargs['post_sim_func']
            del kwargs['post_sim_func']
        else:
            post_sim_func = self.__post_sim_func

        ClusterSimTest.__init__(self, name, pre_sim_func=pre_sim_func, sim_func=sim_func, post_sim_func=post_sim_func, oh_pool=oh_pool, **kwargs)

        nobjects = self._cs.num_random_objects

        self._cs.num_random_objects = 0
        self._cs.num_pack_objects = nobjects / self._cs.num_oh
        self._cs.object_pack = packname
        self._cs.pack_dump = True

        self.bench = FlowFairness(self._cc, self._cs, scheme=scheme, payload=payload, local=local)