public override void RunExample(Arguments a) { this.args = (BenchmarkArguments)a; shared = new BenchmarkShared(args); if (args.sync) { ClientPolicy policy = new ClientPolicy(); policy.user = args.user; policy.password = args.password; policy.tlsPolicy = args.tlsPolicy; policy.authMode = args.authMode; client = new AerospikeClient(policy, args.hosts); try { args.SetServerSpecific(client); threads = new BenchmarkThreadSync[args.threadMax]; for (int i = 0; i < args.threadMax; i++) { threads[i] = new BenchmarkThreadSync(console, args, shared, this, client); } RunThreads(); } finally { client.Close(); } } else { console.Info("Maximum concurrent commands: " + args.commandMax); AsyncClientPolicy policy = new AsyncClientPolicy(); policy.user = args.user; policy.password = args.password; policy.tlsPolicy = args.tlsPolicy; policy.authMode = args.authMode; policy.asyncMaxCommands = args.commandMax; AsyncClient client = new AsyncClient(policy, args.hosts); this.client = client; try { args.SetServerSpecific(client); threads = new BenchmarkThreadAsync[args.threadMax]; for (int i = 0; i < args.threadMax; i++) { threads[i] = new BenchmarkThreadAsync(console, args, shared, this, client); } RunThreads(); } finally { client.Close(); } } }
public BenchmarkThread(Console console, BenchmarkArguments args, BenchmarkShared shared, Example example) { this.console = console; this.args = args; this.shared = shared; this.example = example; random = new RandomShift(); }
public override void RunExample(Arguments a) { this.args = (BenchmarkArguments)a; shared = new BenchmarkShared(args); if (args.sync) { ClientPolicy policy = new ClientPolicy(); policy.user = args.user; policy.password = args.password; policy.failIfNotConnected = true; client = new AerospikeClient(policy, args.host, args.port); try { args.SetServerSpecific(client); threads = new BenchmarkThreadSync[args.threadMax]; for (int i = 0; i < args.threadMax; i++) { threads[i] = new BenchmarkThreadSync(console, args, shared, this, client); } RunThreads(); } finally { client.Close(); } } else { console.Info("Maximum concurrent commands: " + args.commandMax); AsyncClientPolicy policy = new AsyncClientPolicy(); policy.user = args.user; policy.password = args.password; policy.failIfNotConnected = true; policy.asyncMaxCommands = args.commandMax; AsyncClient client = new AsyncClient(policy, args.host, args.port); this.client = client; try { args.SetServerSpecific(client); threads = new BenchmarkThreadAsync[args.threadMax]; for (int i = 0; i < args.threadMax; i++) { threads[i] = new BenchmarkThreadAsync(console, args, shared, this, client); } RunThreads(); } finally { client.Close(); } } }
public BenchmarkThreadAsync ( Console console, BenchmarkArguments args, BenchmarkShared shared, Example example, AsyncClient client ) : base(console, args, shared, example) { this.client = client; }
public BenchmarkThreadAsync( Console console, BenchmarkArguments args, BenchmarkShared shared, Example example, AsyncClient client ) : base(console, args, shared, example) { this.client = client; }