Exemple #1
0
    def run_benchmarks(self):
        for nodes_trace_config in self.redis_trace_configs:
            for erasure_config in self.erasure_configs:
                erasure_code = erasure_config['code']
                stripe_size = erasure_config['stripe']
                parity_size = erasure_config['parity']
                src = erasure_config['src']

                for bench, bench_param in list(
                        zip(self.benches,
                            self.bench_params)) * self.execute_times:
                    nodes_trace = NodesTrace(**nodes_trace_config)
                    initial_redis_size = nodes_trace.initial_size()

                    with RedisCluster(initial_redis_size) as redis:
                        sb = 'Jedis' if initial_redis_size > 0 else 'Memory'
                        config = [
                            erasure_code, initial_redis_size, sb, stripe_size,
                            parity_size, src
                        ]
                        print("Running with " + str(config))
                        (params, env) = self._get_java_params(redis, *config)
                        with JavaProgram(params, env) as java:
                            try:
                                self._run_benchmark(bench, bench_param, config,
                                                    redis, java, nodes_trace)
                            except Exception as ex:
                                logging.exception(
                                    "The benchmark crashed, continuing with the rest..."
                                )
                    self.save_results_to_file()
Exemple #2
0
def main():

    args = commandLineArguments()
    chan = args['channel']
    # Invoke queue and message
    rc = RedisCluster()
    queue = rc.subscribe(chan)
    get_message(queue)
def main():

    args = commandLineArguments()
    channel = args["channel"]
    message = args["message"]

    # Invoke queue and message
    rc = RedisCluster()
    print(rc.ping())
    rc.publish(channel, message)