Пример #1
0
 public LatencyWriteHandler(BenchmarkThreadAsync parent, Key key, Bin bin)
 {
     this.parent = parent;
     this.key    = key;
     this.bin    = bin;
     this.watch  = Stopwatch.StartNew();
 }
Пример #2
0
        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();
                }
            }
        }
Пример #3
0
 public LatencyBatchHandler(BenchmarkThreadAsync parent)
 {
     this.parent = parent;
     this.watch  = Stopwatch.StartNew();
 }
Пример #4
0
 public BatchHandler(BenchmarkThreadAsync parent)
 {
     this.parent = parent;
 }
Пример #5
0
 public LatencyReadHandler(BenchmarkThreadAsync parent, Key key)
 {
     this.parent = parent;
     this.key    = key;
     this.watch  = Stopwatch.StartNew();
 }
Пример #6
0
 public ReadHandler(BenchmarkThreadAsync parent, Key key)
 {
     this.parent = parent;
     this.key    = key;
 }
Пример #7
0
 public WriteHandler(BenchmarkThreadAsync parent, Key key, Bin bin)
 {
     this.parent = parent;
     this.key    = key;
     this.bin    = bin;
 }
 public WriteHandler(BenchmarkThreadAsync parent, Key key, Bin bin)
 {
     this.parent = parent;
     this.key = key;
     this.bin = bin;
 }
 public ReadHandler(BenchmarkThreadAsync parent, Key key)
 {
     this.parent = parent;
     this.key = key;
 }
 public LatencyWriteHandler(BenchmarkThreadAsync parent, Key key, Bin bin)
 {
     this.parent = parent;
     this.key = key;
     this.bin = bin;
     this.watch = Stopwatch.StartNew();
 }
 public LatencyReadHandler(BenchmarkThreadAsync parent, Key key)
 {
     this.parent = parent;
     this.key = key;
     this.watch = Stopwatch.StartNew();
 }
        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();
                }
            }
        }