Ejemplo n.º 1
0
  /**
   * Constructor for benchmark instance. Configures VoltDB client and prints configuration.
   *
   * @param config Parsed & validated CLI options.
   */
  public AsyncBenchmark(KVConfig config) {
    this.config = config;

    ClientConfig clientConfig = new ClientConfig("", "", new StatusListener());

    if (config.autotune) {
      clientConfig.enableAutoTune();
      clientConfig.setAutoTuneTargetInternalLatency(config.latencytarget);
    } else {
      clientConfig.setMaxTransactionsPerSecond(config.ratelimit);
    }
    client = ClientFactory.createClient(clientConfig);

    periodicStatsContext = client.createStatsContext();
    fullStatsContext = client.createStatsContext();

    processor =
        new PayloadProcessor(
            config.keysize,
            config.minvaluesize,
            config.maxvaluesize,
            config.entropy,
            config.poolsize,
            config.usecompression);

    System.out.print(HORIZONTAL_RULE);
    System.out.println(" Command Line Configuration");
    System.out.println(HORIZONTAL_RULE);
    System.out.println(config.getConfigDumpString());
  }
Ejemplo n.º 2
0
  static Client createClient() {
    StatusListener statusListener = new StatusListener();
    ClientConfig clientConfig = new ClientConfig("", "", statusListener);
    if (config.autoTune) {
      clientConfig.enableAutoTune();
      clientConfig.setAutoTuneTargetInternalLatency(config.latencyTarget);
    } else {
      clientConfig.setMaxTransactionsPerSecond(config.rateLimit);
    }
    Client client = ClientFactory.createClient(clientConfig);
    clientRef.set(client);

    periodicStatsContext = client.createStatsContext();
    fullStatsContext = client.createStatsContext();

    return client;
  }
  /**
   * Constructor for benchmark instance. Configures VoltDB client and prints configuration.
   *
   * @param config Parsed & validated CLI options.
   */
  public BaseBenchmark(BenchmarkConfig config) {
    this.config = config;

    ClientConfig clientConfig =
        new ClientConfig(config.user, config.password, new StatusListener());
    if (config.autotune) {
      clientConfig.enableAutoTune();
      clientConfig.setAutoTuneTargetInternalLatency(config.latencytarget);
    } else {
      clientConfig.setMaxTransactionsPerSecond(config.ratelimit);
    }
    client = ClientFactory.createClient(clientConfig);

    periodicStatsContext = client.createStatsContext();
    fullStatsContext = client.createStatsContext();

    printHeading("Command Line Configuration");
    System.out.println(config.getConfigDumpString());
  }